2
mediastreamer2 library - modular sound and video processing and streaming
3
Copyright (C) 2010 Belledonne Communications SARL <simon.morlat@linphone.org>
5
This program is free software; you can redistribute it and/or
6
modify it under the terms of the GNU General Public License
7
as published by the Free Software Foundation; either version 2
8
of the License, or (at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program; if not, write to the Free Software
17
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
#if defined(HAVE_CONFIG_H)
21
#include "mediastreamer-config.h"
24
#include "mediastreamer2/msextdisplay.h"
26
static void ext_display_init(MSFilter *f){
29
static void ext_display_uninit(MSFilter *f){
32
static void ext_display_process(MSFilter *f){
33
MSExtDisplayOutput output;
35
mblk_t *local_im=NULL;
37
memset(&output,0,sizeof(output));
39
/*get most recent message and draw it*/
40
if ( f->inputs[1]!=NULL && (local_im=ms_queue_peek_last(f->inputs[1]))!=NULL) {
41
if (ms_yuv_buf_init_from_mblk(&output.local_view,local_im)==0){
45
if (f->inputs[0]!=NULL && (main_im=ms_queue_peek_last(f->inputs[0]))!=NULL) {
46
if (ms_yuv_buf_init_from_mblk(&output.remote_view,main_im)==0){
50
ms_filter_notify_synchronous(f,MS_EXT_DISPLAY_ON_DRAW,&output);
52
if (f->inputs[0]!=NULL)
53
ms_queue_flush(f->inputs[0]);
54
if (f->inputs[1]!=NULL)
55
ms_queue_flush(f->inputs[1]);
61
MSFilterDesc ms_ext_display_desc={
64
N_("A display filter sending the buffers to draw to the upper layer"),
78
MSFilterDesc ms_ext_display_desc={
79
.id=MS_EXT_DISPLAY_ID,
81
.text=N_("A display filter sending the buffers to draw to the upper layer"),
82
.category=MS_FILTER_OTHER,
85
.init=ext_display_init,
86
.process=ext_display_process,
87
.uninit=ext_display_uninit,
92
MS_FILTER_DESC_EXPORT(ms_ext_display_desc)