e8704544f4
- Use autovideosink - xvimagesink does not work with cards with no xv ports available and cant be used if wanted to use the fluendo hardware accelerated playback codec - Use autoaudiosink - let gstreamer choose best audio playback plugin - Catch when autosinks add known elements so that we can manipulate properties on them - Adjust caps of various media types to work better with gstreamer, some codecs are picky about having certain fields available - Remove unneeded plugins such as "ffmpegcolorspace" and "videoscale" - these do not work correctly with fluendo hardware accelerated playback codec - Name audio/video gstreamer elements better for easier debugging - Update gstreamer pipeline and element properties to handle playback better - Detect when valid timestamps are available for buffer from server and try to account for when they are not valid - Start time is much more reliable then end time from server for various media formats, so use it when possible to make decisions instead of end time - Do not rebuild gstreamer pipeline for a seek(very expensive), instead reset gstreamer time to 0 and maintain offset between real time and gstreamer time - Change buffer filled function back to a buffer level function, so that we can use buffer level to make better choices above gstreamer decoder in tsmf - Remove ack function from gstreamer, instead rely on ack thread to handle acks - Rework X11 gstreamer code to handle various videosinks which implement the XOverlayInterface and to keep more detailed information on the sub-window that is used for display - Add check to see if a decoder is available for telling the server the client various media types - Add in support for M4S2 and WMA1 media types - Fix flush message handling, they are for individual streams and not the entire presentation - Delay eos response to try to allow more time for buffers to be loaded into decoder, as we anticipate acks to server and the server will issue stop as soon as we ack eos. - Fix issue with geometry info being ignored when resent for new streams within existing presentation - Fixed volume level initialization issue when a stream is stopped and restarted - Attempt to sync video/audio streams...because we run two different gstreamer pipelines - they can enter pause/playing states at different times and are thus not synchronized. Attempt to adjust video buffer timestamps based on difference between audio/video running time to account for this difference. This logic accounts for a huge improvement in audio/video sync(ie. lip sync to words)
70 lines
2.9 KiB
C
70 lines
2.9 KiB
C
/**
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
|
* Video Redirection Virtual Channel - Media Container
|
|
*
|
|
* Copyright 2010-2011 Vic Lee
|
|
* Copyright 2012 Hewlett-Packard Development Company, L.P.
|
|
* Copyright 2015 Thincast Technologies GmbH
|
|
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
/**
|
|
* The media container maintains a global list of presentations, and a list of
|
|
* streams in each presentation.
|
|
*/
|
|
|
|
#ifndef __TSMF_MEDIA_H
|
|
#define __TSMF_MEDIA_H
|
|
|
|
#include <freerdp/freerdp.h>
|
|
|
|
typedef struct _TSMF_PRESENTATION TSMF_PRESENTATION;
|
|
|
|
typedef struct _TSMF_STREAM TSMF_STREAM;
|
|
|
|
typedef struct _TSMF_SAMPLE TSMF_SAMPLE;
|
|
|
|
TSMF_PRESENTATION *tsmf_presentation_new(const BYTE *guid, IWTSVirtualChannelCallback *pChannelCallback);
|
|
TSMF_PRESENTATION *tsmf_presentation_find_by_id(const BYTE *guid);
|
|
BOOL tsmf_presentation_start(TSMF_PRESENTATION *presentation);
|
|
BOOL tsmf_presentation_stop(TSMF_PRESENTATION *presentation);
|
|
UINT tsmf_presentation_sync(TSMF_PRESENTATION *presentation);
|
|
BOOL tsmf_presentation_paused(TSMF_PRESENTATION *presentation);
|
|
BOOL tsmf_presentation_restarted(TSMF_PRESENTATION *presentation);
|
|
BOOL tsmf_presentation_volume_changed(TSMF_PRESENTATION *presentation, UINT32 newVolume, UINT32 muted);
|
|
BOOL tsmf_presentation_set_geometry_info(TSMF_PRESENTATION *presentation,
|
|
UINT32 x, UINT32 y, UINT32 width, UINT32 height,
|
|
int num_rects, RDP_RECT *rects);
|
|
void tsmf_presentation_set_audio_device(TSMF_PRESENTATION *presentation,
|
|
const char *name, const char *device);
|
|
BOOL tsmf_presentation_flush(TSMF_PRESENTATION *presentation);
|
|
void tsmf_presentation_free(TSMF_PRESENTATION *presentation);
|
|
|
|
TSMF_STREAM *tsmf_stream_new(TSMF_PRESENTATION *presentation, UINT32 stream_id, rdpContext* rdpcontext);
|
|
TSMF_STREAM *tsmf_stream_find_by_id(TSMF_PRESENTATION *presentation, UINT32 stream_id);
|
|
BOOL tsmf_stream_set_format(TSMF_STREAM *stream, const char *name, wStream *s);
|
|
void tsmf_stream_end(TSMF_STREAM *stream, UINT32 message_id, IWTSVirtualChannelCallback* pChannelCallback);
|
|
void tsmf_stream_free(TSMF_STREAM *stream);
|
|
void tsmf_stream_flush(TSMF_STREAM* stream);
|
|
|
|
BOOL tsmf_stream_push_sample(TSMF_STREAM *stream, IWTSVirtualChannelCallback *pChannelCallback,
|
|
UINT32 sample_id, UINT64 start_time, UINT64 end_time, UINT64 duration, UINT32 extensions,
|
|
UINT32 data_size, BYTE *data);
|
|
|
|
BOOL tsmf_media_init(void);
|
|
|
|
#endif
|
|
|