FreeRDP
tsmf_platform.h
1 /*
2  * FreeRDP: A Remote Desktop Protocol Implementation
3  * Video Redirection Virtual Channel - GStreamer Decoder
4  * platform specific functions
5  *
6  * (C) Copyright 2014 Thincast Technologies GmbH
7  * (C) Copyright 2014 Armin Novak <armin.novak@thincast.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 #ifndef FREERDP_CHANNEL_TSMF_CLIENT_GST_PLATFORM_H
23 #define FREERDP_CHANNEL_TSMF_CLIENT_GST_PLATFORM_H
24 
25 #include <gst/gst.h>
26 #include <tsmf_decoder.h>
27 
28 typedef struct
29 {
30  ITSMFDecoder iface;
31 
32  int media_type; /* TSMF_MAJOR_TYPE_AUDIO or TSMF_MAJOR_TYPE_VIDEO */
33 
34  gint64 duration;
35 
36  GstState state;
37  GstCaps* gst_caps;
38 
39  GstElement* pipe;
40  GstElement* src;
41  GstElement* queue;
42  GstElement* outsink;
43  GstElement* volume;
44 
45  BOOL ready;
46  BOOL paused;
47  UINT64 last_sample_start_time;
48  UINT64 last_sample_end_time;
49  BOOL seeking;
50  UINT64 seek_offset;
51 
52  double gstVolume;
53  BOOL gstMuted;
54 
55  int pipeline_start_time_valid; /* We've set the start time and have not reset the pipeline */
56  int shutdown; /* The decoder stream is shutting down */
57 
58  void* platform;
59 
60  BOOL (*ack_cb)(void*, BOOL);
61  void (*sync_cb)(void*);
62  void* stream;
63 
65 
66 const char* tsmf_platform_get_video_sink(void);
67 const char* tsmf_platform_get_audio_sink(void);
68 
69 int tsmf_platform_create(TSMFGstreamerDecoder* decoder);
70 int tsmf_platform_set_format(TSMFGstreamerDecoder* decoder);
71 int tsmf_platform_register_handler(TSMFGstreamerDecoder* decoder);
72 int tsmf_platform_free(TSMFGstreamerDecoder* decoder);
73 
74 int tsmf_window_create(TSMFGstreamerDecoder* decoder);
75 int tsmf_window_resize(TSMFGstreamerDecoder* decoder, int x, int y, int width, int height,
76  int nr_rect, RDP_RECT* visible);
77 int tsmf_window_destroy(TSMFGstreamerDecoder* decoder);
78 
79 int tsmf_window_map(TSMFGstreamerDecoder* decoder);
80 int tsmf_window_unmap(TSMFGstreamerDecoder* decoder);
81 
82 BOOL tsmf_gstreamer_add_pad(TSMFGstreamerDecoder* mdecoder);
83 void tsmf_gstreamer_remove_pad(TSMFGstreamerDecoder* mdecoder);
84 
85 #endif /* FREERDP_CHANNEL_TSMF_CLIENT_GST_PLATFORM_H */