tizen 2.0 init
[framework/multimedia/gst-plugins-ext0.10.git] / avsystem / src / gstavsysmemsink.c
1 /*
2  * avsystem
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>
7  *
8  * This library is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU Lesser General Public License as published by the
10  * Free Software Foundation; either version 2.1 of the License, or (at your option)
11  * any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but WITHOUT ANY
14  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
15  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16  * License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; if not, write to the Free Software Foundation, Inc., 51
20  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  */
23
24
25 #if defined(_MM_PROJECT_FLOATER) || defined(_MM_PROJECT_PROTECTOR) || defined(_MM_PROJECT_VOLANS)
26 #define VERSION "0.10.19" // sec
27 #define PACKAGE "gstreamer"
28 #elif defined(_MM_PROJECT_ADORA)
29 #define VERSION "0.10.9" // mavell
30 #define PACKAGE "gstreamer"
31 #else
32 #include <config.h>
33 #endif
34
35 #include <string.h>
36 #include <stdlib.h>
37
38 #include "gstavsysmemsink.h"
39
40 #define debug_enter g_print
41 #define debug_leave g_print
42 #define debug_fenter() g_print("enter: %s\n",__FUNCTION__)
43 #define debug_fleave() g_print("leave: %s\n",__FUNCTION__)
44 #define debug_msg g_print
45 #define debug_verbose g_print
46 #define debug_warning g_print
47 #define debug_error g_print
48
49 #define GST_CAT_DEFAULT avsysmemsink_debug
50
51 GST_DEBUG_CATEGORY_STATIC (avsysmemsink_debug);
52
53 enum 
54 {
55     SIGNAL_VIDEO_STREAM,
56     LAST_SIGNAL
57 };
58
59 enum 
60 {
61         PROP_0,
62         PROP_WIDTH,
63         PROP_HEIGHT,
64         PROP_ROTATE,
65 };
66
67 static GstStaticPadTemplate sink_factory = 
68         GST_STATIC_PAD_TEMPLATE ("sink",
69                                 GST_PAD_SINK, GST_PAD_ALWAYS, 
70                                 GST_STATIC_CAPS (
71                                     "video/x-raw-yuv, "
72                                     "format = (fourcc){YV12}, "
73                                     "framerate = (fraction) [ 0, MAX ], "
74                                     "width = (int) [ 1, MAX ], "
75                                     "height = (int) [ 1, MAX ]; "
76                                     "video/x-raw-yuv, "
77                                     "format = (fourcc){I420}, "
78                                     "framerate = (fraction) [ 0, MAX ], "
79                                     "width = (int) [ 1, MAX ], "
80                                     "height = (int) [ 1, MAX ]; "
81                                     "video/x-raw-rgb, "
82                                     "bpp = (int)32, "
83                                     "depth = (int)24 ")
84                             );
85
86 static GstElementDetails AvsysMemSink_details = {
87             "AV-system Stream callback",
88             "Sink/Video", 
89             "Stream sink for AV-System GStreamer Plug-in", 
90             ""
91 };
92
93 static guint gst_avsysmemsink_signals[LAST_SIGNAL] = { 0 };
94
95
96 #ifdef G_ENABLE_DEBUG
97 #define g_marshal_value_peek_int(v)      g_value_get_int (v)
98 #define g_marshal_value_peek_pointer(v)  g_value_get_pointer (v)
99 #else /* !G_ENABLE_DEBUG */
100 #define g_marshal_value_peek_int(v)      (v)->data[0].v_int
101 #define g_marshal_value_peek_pointer(v)  (v)->data[0].v_pointer
102 #endif /* !G_ENABLE_DEBUG */
103
104
105 #define     GET_PIXEL(buf, x, y, stride)  (*((unsigned char*)(buf) + (x) + (y)*(stride)))
106
107 #define     GET_RED(Y,U,V)      ((9535 * (Y - 16) + 13074 * (V - 128)) >> 13)
108 #define     GET_GREEN(Y,U,V)  ((9535 * (Y - 16) - 6660 * (V - 128) - 3203 * (U - 128)) >> 13 )
109 #define     GET_BLUE(Y,U,V)   ((9535 * (Y - 16) + 16531 * (U - 128)) >> 13 )
110
111 #define     UCLIP(a) (((a)<0)?0:((a)>255)?255:(a))
112
113
114 static void
115 yuv420toargb(unsigned char *src, unsigned char *dst, int width, int height)
116 {
117     int h,w;
118     int y=0,u=0,v=0;
119     int a=0,r=0,g=0,b=0;
120     
121     unsigned char* pixel;
122
123     int index=0;
124
125     unsigned char       *pY;
126     unsigned char       *pU;
127     unsigned char       *pV;
128
129     pY = src ;
130     pU = src + (width * height) ;
131     pV = src + (width * height) + (width * height /4) ;
132
133     a = 255;
134
135     for(h = 0 ; h < height; h++)
136     {
137         for(w = 0 ; w < width; w++)
138         {
139             y = GET_PIXEL(pY,w,h,width);
140             u = GET_PIXEL(pU,w/2,h/2,width/2);
141             v = GET_PIXEL(pV,w/2,h/2,width/2);
142
143             r = GET_RED(y,u,v);
144             g = GET_GREEN(y,u,v);
145             b = GET_BLUE(y,u,v);
146
147             r = UCLIP(r);
148             g = UCLIP(g);
149             b = UCLIP(b);
150
151             index = (w + (h* width)) * 4;
152             dst[index] = r;
153             dst[index+1] = g;
154             dst[index+2] = b;
155             dst[index+3] = a;
156         }
157     }
158 }
159
160 static void
161 rotate_pure(unsigned char *src, unsigned char *dst, int width,int height,int angle,int bpp)
162 {
163
164     int     size;
165     int     new_x,new_y;
166     int     org_x,org_y;
167     int     dst_width;
168     int     src_idx, dst_idx;
169     
170     size = width * height * bpp;
171     
172     if(angle == 0)
173     {
174         memcpy(dst,src,size);
175         return;
176     }
177
178     for(org_y =0; org_y < height; org_y++)
179     {
180         for(org_x = 0; org_x < width ; org_x++)
181         {
182             if(angle == 90)
183             {
184                 new_x = height - org_y;
185                 new_y = org_x;
186
187                 dst_width = height;
188             }
189             else if(angle == 180)
190             {
191                 new_x = width - org_x;
192                 new_y = height - org_y;
193                 dst_width = width;
194             }
195             else if(angle == 270)
196             {
197                 new_x = org_y;
198                 new_y = width - org_x;
199                 dst_width = height;
200             }
201             else
202             {
203                 g_print("Not support Rotate : %d\n",angle);
204                 return;
205             }
206
207             src_idx = org_x + (org_y * width);
208             dst_idx = new_x + (new_y * dst_width);
209
210             memcpy(dst + (dst_idx*bpp), src+(src_idx *bpp),bpp);
211         }
212     }
213     
214 }
215
216 static void
217 resize_pure(unsigned char *src, unsigned char *dst, int src_width, int src_height, int dst_width,int dst_height, int bpp)
218 {
219     float       xFactor,yFactor;
220
221     float               org_fx,org_fy;
222     int         org_x,org_y;
223
224     int         x,y;
225
226     int         src_index,dst_index;
227
228     unsigned short *pshortSrc;
229     unsigned short *pshortDst;
230
231     if(bpp == 2)
232     {
233         pshortSrc = (unsigned short*)src;
234         pshortDst = (unsigned short*)dst;
235     }
236
237     xFactor = (float)((dst_width<<16) / src_width);
238     yFactor = (float)((dst_height<<16) / src_height);
239
240     for(y = 0; y < dst_height; y++)
241     {
242         for(x = 0; x < dst_width; x++)
243         {
244             org_fx = (float)((x<<16)/xFactor);
245             org_fy = (float)((y<<16)/yFactor);
246
247             org_x = (int)(org_fx);
248             org_y = (int)(org_fy);
249
250             src_index = org_x + (org_y * src_width);
251             dst_index = x + (y*dst_width);
252
253             memcpy(dst+(dst_index *bpp ),src+(src_index *bpp),bpp);
254         }
255     }
256 }
257
258 /* BOOLEAN:POINTER,INT,INT (avsysvideosink.c:1) */
259 void
260 gst_avsysmemsink_BOOLEAN__POINTER_INT_INT (GClosure         *closure,
261                                              GValue         *return_value G_GNUC_UNUSED,
262                                              guint          n_param_values,
263                                              const GValue   *param_values,
264                                              gpointer       invocation_hint G_GNUC_UNUSED,
265                                              gpointer       marshal_data)
266 {
267     typedef gboolean (*GMarshalFunc_BOOLEAN__POINTER_INT_INT) (gpointer     data1,
268                                                                 gpointer     arg_1,
269                                                                 gint         arg_2,
270                                                                 gint         arg_3,
271                                                                 gpointer     data2);
272     register GMarshalFunc_BOOLEAN__POINTER_INT_INT callback;
273     register GCClosure *cc = (GCClosure*) closure;
274     register gpointer data1, data2;
275
276     gboolean v_return;
277
278     g_return_if_fail (return_value != NULL);
279     g_return_if_fail (n_param_values == 4);
280
281     if (G_CCLOSURE_SWAP_DATA (closure))
282     {
283         data1 = closure->data;
284         data2 = g_value_peek_pointer (param_values + 0);
285     }
286     else
287     {
288         data1 = g_value_peek_pointer (param_values + 0);
289         data2 = closure->data;
290     }
291     callback = (GMarshalFunc_BOOLEAN__POINTER_INT_INT) (marshal_data ? marshal_data : cc->callback);
292
293     v_return = callback (data1,
294                         g_marshal_value_peek_pointer (param_values + 1),
295                         g_marshal_value_peek_int (param_values + 2),
296                         g_marshal_value_peek_int (param_values + 3),
297                         data2);
298
299     g_value_set_boolean (return_value, v_return);
300 }
301
302 static void gst_avsysmemsink_init_interfaces (GType type);
303
304
305 GST_BOILERPLATE_FULL (GstAvsysMemSink, gst_avsysmemsink, GstVideoSink, GST_TYPE_VIDEO_SINK, gst_avsysmemsink_init_interfaces);
306
307
308 static void 
309 gst_avsysmemsink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
310 {
311         GstAvsysMemSink *AvsysMemSink = GST_AVSYS_MEM_SINK (object);
312         switch (prop_id) {
313                 case PROP_0:
314                         break;
315                 case PROP_WIDTH:
316                if(AvsysMemSink->dst_width != g_value_get_int (value))
317                {
318                                 AvsysMemSink->dst_width = g_value_get_int (value);
319                     AvsysMemSink->dst_changed = 1;
320                }
321                         break;
322                 case PROP_HEIGHT:
323                         if(AvsysMemSink->dst_height != g_value_get_int (value))
324                         {
325                                 AvsysMemSink->dst_height = g_value_get_int (value);
326                     AvsysMemSink->dst_changed = 1;
327                         }
328                         break;
329           case PROP_ROTATE:
330                if(AvsysMemSink->rotate != g_value_get_int(value))
331                {
332                    AvsysMemSink->rotate = g_value_get_int(value);
333                    AvsysMemSink->dst_changed = 1;
334                }
335                break;
336                 default:
337                         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
338                         g_print ("invalid property id\n");
339                         break;
340         };
341 }
342
343 static void 
344 gst_avsysmemsink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
345 {
346         GstAvsysMemSink *AvsysMemSink = GST_AVSYS_MEM_SINK (object);
347
348         switch (prop_id) {
349                 case PROP_0:
350                         break;
351                 case PROP_WIDTH:
352                         g_value_set_int (value, AvsysMemSink->dst_width);
353                         break;
354                 case PROP_HEIGHT:
355                         g_value_set_int (value, AvsysMemSink->dst_height);
356                         break;
357           case PROP_ROTATE:
358                g_value_set_int (value, AvsysMemSink->rotate);
359                break;
360                 default:
361                         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
362                         debug_warning ("invalid property id\n");
363                         break;
364         }
365 }
366
367 static void
368 free_buffer(GstAvsysMemSink *AvsysMemSink)
369 {
370     if(AvsysMemSink->con_buf)
371         free(AvsysMemSink->con_buf);
372
373     if(AvsysMemSink->rot_buf)
374         free(AvsysMemSink->rot_buf);
375
376     if(AvsysMemSink->rsz_buf)
377         free(AvsysMemSink->rsz_buf);
378
379     AvsysMemSink->con_buf = NULL;
380     AvsysMemSink->rot_buf = NULL;
381     AvsysMemSink->rsz_buf = NULL;
382
383 }
384 static GstStateChangeReturn 
385 gst_avsysmemsink_change_state (GstElement *element, GstStateChange transition)
386 {
387         GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
388         GstAvsysMemSink *AvsysMemSink = GST_AVSYS_MEM_SINK (element);
389         switch (transition) {
390                 case GST_STATE_CHANGE_NULL_TO_READY:
391                         debug_msg ("GST AVSYS DISPLAY SINK: NULL -> READY\n");
392                         break;
393                 case GST_STATE_CHANGE_READY_TO_PAUSED:
394                         debug_msg ("GST AVSYS DISPLAY SINK: READY -> PAUSED\n");
395                         break;
396                 case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
397                         debug_msg ("GST AVSYS DISPLAY SINK: PAUSED -> PLAYING\n");
398                         break;
399                 default:
400                         break;
401         }
402
403         ret = GST_ELEMENT_CLASS(parent_class)->change_state (element, transition);
404         if (ret == GST_STATE_CHANGE_FAILURE) {
405                 return ret;
406         }
407
408         switch (transition) {
409                 case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
410                         debug_msg ("GST AVSYS MEM SINK: PLAYING -> PAUSED\n");
411                         break;
412                 case GST_STATE_CHANGE_PAUSED_TO_READY:
413                         debug_msg ("GST AVSYS MEM SINK: PAUSED -> READY\n");
414                free_buffer(AvsysMemSink);        
415                         break;
416                 case GST_STATE_CHANGE_READY_TO_NULL:
417                         debug_msg ("GST AVSYS MEM SINK: READY -> NULL\n");
418                         break;
419                 default:
420                         break;
421         }
422
423         return ret;
424
425
426 }
427
428
429 static gboolean
430 gst_avsysmemsink_set_caps (GstBaseSink * bs, GstCaps * caps)
431 {
432     GstAvsysMemSink *s = GST_AVSYS_MEM_SINK (bs);
433     GstStructure *structure;
434     gint width = 0;
435     gint height = 0;
436
437     if (caps != NULL)
438     {
439         guint32 fourcc;
440         char *name = NULL;
441         int bpp = 0, depth = 0;
442
443         structure = gst_caps_get_structure (caps, 0);
444
445         /**/
446         name = (char *) gst_structure_get_name (structure);
447         debug_msg ("CAPS NAME: %s\n", name);
448
449                 if (gst_structure_has_name (structure, "video/x-raw-rgb"))
450                 {
451                         s->is_rgb = TRUE;
452                 }
453                 else if (gst_structure_has_name (structure, "video/x-raw-yuv")) 
454                 {
455                         s->is_rgb = FALSE;
456                 }
457
458         /* get source size */
459         gst_structure_get_int (structure, "height", &height);
460         gst_structure_get_int (structure, "width", &width);
461
462         if (gst_structure_get_fourcc (structure, "format", &fourcc)) 
463         {
464             switch (fourcc) 
465             {
466                 case GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'):
467                     debug_warning("set format AVSYS_VIDEO_FORMAT_UYVY\n");
468                     break;
469                 case GST_MAKE_FOURCC ('Y', 'V', '1', '6'):
470                 case GST_MAKE_FOURCC ('Y', '4', '2', 'B'):
471                     debug_warning("set format AVSYS_VIDEO_FORMAT_YUV422\n");
472                     break;
473                 case GST_MAKE_FOURCC ('Y', 'V', '1', '2'):
474                     debug_warning("set format AVSYS_VIDEO_FORMAT_YUV420\n");
475                     break;
476                 case GST_MAKE_FOURCC ('R', 'G', 'B', ' '):
477                     debug_warning("set format AVSYS_VIDEO_FORMAT_RGB565\n");
478                     break;
479                 default:
480                     debug_warning("set default format AVSYS_VIDEO_FORMAT_RGB565\n");
481                     break;
482             }
483         }
484
485         if( s->src_width != width || 
486             s->src_height != height) 
487         {
488             debug_warning ("DISPLAY: Video Source Changed! [%d x %d] -> [%d x %d]\n",
489                                     s->src_width, s->src_height, width, height);
490             s->src_changed = TRUE;
491         }
492
493         s->src_width = width;
494         s->src_height = height;
495
496         if(s->dst_width ==0)
497         {
498             s->dst_width = width;
499             s->dst_changed = 1;
500         }
501
502         if(s->dst_height == 0)
503         {
504             s->dst_height = height;
505             s->dst_changed = 1;            
506         }
507         debug_msg ("SRC CAPS: width:%d, height:%d \n", width, height);
508     } 
509     else 
510     {
511         debug_warning ("caps is NULL.\n");
512     }
513
514     debug_fleave ();
515
516     return TRUE;
517 }
518
519 static GstFlowReturn
520 gst_avsysmemsink_preroll (GstBaseSink * bsink, GstBuffer * buf)
521 {
522         GstAvsysMemSink *AvsysMemSink = GST_AVSYS_MEM_SINK (bsink);
523
524         AvsysMemSink->src_length = GST_BUFFER_SIZE (buf);
525         debug_msg ("SRC LENGTH: %d\n", AvsysMemSink->src_length);
526
527         return GST_FLOW_OK;
528 }
529
530 static GstFlowReturn
531 gst_avsysmemsink_show_frame (GstBaseSink * bsink, GstBuffer * buf)
532 {
533         GstAvsysMemSink *s = GST_AVSYS_MEM_SINK (bsink);
534         gboolean res = FALSE;
535         int f_size;
536         f_size = GST_BUFFER_SIZE (buf);
537         unsigned char       *dst_buf;
538
539         if ( ! s->is_rgb )
540         {
541             if (s->dst_changed == TRUE)
542             {
543                 if(s->con_buf)
544                 {
545                     free(s->con_buf);
546                     s->con_buf = NULL;
547                 }
548
549                 if(s->rot_buf)
550                 {
551                     free(s->rot_buf);
552                     s->rot_buf = NULL;
553                 }
554
555                 if(s->rsz_buf)
556                 {
557                     free(s->rsz_buf);
558                     s->rsz_buf = NULL;
559                 }
560
561                 s->con_buf = malloc(s->src_width * s->src_height * 4);
562                 if(s->rotate != 0)
563                 {
564                     s->rot_buf = malloc(s->src_width * s->src_height * 4);
565                 }
566
567                 s->rsz_buf = malloc(s->dst_width * s->dst_height *4);
568                 
569                 s->dst_changed = FALSE;
570             } 
571
572             yuv420toargb(GST_BUFFER_DATA (buf),s->con_buf,s->src_width, s->src_height);
573             if(s->rotate != 0)
574             {
575                 rotate_pure(s->con_buf,s->rot_buf,s->src_width, s->src_height,s->rotate,4);
576                 if(s->rotate == 90 || s->rotate == 270)
577                 {
578                     resize_pure(s->rot_buf,s->rsz_buf,s->src_height,s->src_width,
579                                 s->dst_width, s->dst_height,4);
580                 }
581                 else
582                 {
583                     resize_pure(s->rot_buf,s->rsz_buf,s->src_width,s->src_height,
584                                 s->dst_width, s->dst_height,4);
585                 }
586             }
587             else
588             {
589                 resize_pure(s->con_buf,s->rsz_buf,s->src_width,s->src_height,
590                                 s->dst_width, s->dst_height,4);
591             }
592
593             /* emit signal for video-stream */
594             g_signal_emit (s,gst_avsysmemsink_signals[SIGNAL_VIDEO_STREAM],
595                             0,s->rsz_buf,
596                             s->dst_width,s->dst_height,
597                             &res);
598         }
599         else
600         {       
601                 /* NOTE : video can be resized by convert plugin's set caps on running time. 
602                  * So, it should notice it to application through callback func.
603                  */
604                  g_signal_emit (s, gst_avsysmemsink_signals[SIGNAL_VIDEO_STREAM],
605                                     0, GST_BUFFER_DATA (buf),
606                                     s->src_width, s->src_height,
607                                     &res);
608          }
609
610     /*check video stream callback result.*/
611     if (res) 
612     {
613         //debug_verbose("Video stream is called.\n");
614         return GST_FLOW_OK;
615     }
616
617     return GST_FLOW_OK;
618 }
619
620 static void
621 gst_avsysmemsink_init_interfaces (GType type)
622 {
623         /*void*/
624 }
625
626
627 static void 
628 gst_avsysmemsink_base_init (gpointer klass)
629 {
630         GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
631
632         gst_element_class_add_pad_template (element_class, 
633                                 gst_static_pad_template_get (&sink_factory));
634         gst_element_class_set_details (element_class, &AvsysMemSink_details);
635 }
636
637 static void 
638 gst_avsysmemsink_class_init (GstAvsysMemSinkClass *klass)
639 {
640         GObjectClass *gobject_class  = (GObjectClass*) klass;
641         GstElementClass *gstelement_class = (GstElementClass*) klass;
642         GstBaseSinkClass *gstbasesink_class = (GstBaseSinkClass *) klass;
643
644     
645         parent_class = g_type_class_peek_parent (klass);
646
647         gobject_class->set_property = gst_avsysmemsink_set_property;
648         gobject_class->get_property = gst_avsysmemsink_get_property;
649
650
651         g_object_class_install_property (gobject_class, PROP_WIDTH,
652                                                                                 g_param_spec_int ("width",
653                                                                                                         "Width",
654                                                                                                         "Width of display",
655                                                                                                         0, G_MAXINT, 176,
656                                                                                                         G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
657
658
659         g_object_class_install_property (gobject_class, PROP_HEIGHT,
660                                                                                 g_param_spec_int ("height",
661                                                                                                         "Height",
662                                                                                                         "Height of display",
663                                                                                                         0, G_MAXINT, 144,
664                                                                                                         G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
665
666         g_object_class_install_property (gobject_class, PROP_ROTATE,
667                                                                                 g_param_spec_int ("rotate",
668                                                                                                         "Rotate",
669                                                                                                         "Rotate of display",
670                                                                                                         0, G_MAXINT, 0,
671                                                                                                         G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
672
673
674         /**
675         * GstAvsysVideoSink::video-stream:
676         */
677         gst_avsysmemsink_signals[SIGNAL_VIDEO_STREAM] = g_signal_new (
678                                                         "video-stream",
679                                                         G_TYPE_FROM_CLASS (klass),
680                                                         G_SIGNAL_RUN_LAST,
681                                                         0,
682                                                         NULL,
683                                                         NULL,
684                                                         gst_avsysmemsink_BOOLEAN__POINTER_INT_INT,
685                                                         G_TYPE_BOOLEAN,
686                                                         3,
687                                                         G_TYPE_POINTER, G_TYPE_INT, G_TYPE_INT);
688
689     gstelement_class->change_state = gst_avsysmemsink_change_state;
690
691     gstbasesink_class->set_caps = gst_avsysmemsink_set_caps;
692     gstbasesink_class->preroll = GST_DEBUG_FUNCPTR (gst_avsysmemsink_preroll);
693     gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_avsysmemsink_show_frame);
694
695     
696     GST_DEBUG_CATEGORY_INIT (avsysmemsink_debug, 
697                             "AvsysMemSink", 
698                             0, 
699                             "AV system based GStreamer Plug-in");
700 }
701
702
703 static void 
704 gst_avsysmemsink_init (GstAvsysMemSink *AvsysMemSink, GstAvsysMemSinkClass *klass)
705 {
706     /*private*/
707     AvsysMemSink->src_width = 0;
708     AvsysMemSink->src_height = 0;
709
710     AvsysMemSink->src_changed = 0;
711
712     /*property*/
713     AvsysMemSink->dst_width = 0;
714     AvsysMemSink->dst_height = 0;
715
716     AvsysMemSink->dst_changed = 0;
717
718     AvsysMemSink->rotate = 0;
719
720     AvsysMemSink->con_buf = NULL;
721     AvsysMemSink->rot_buf = NULL;
722     AvsysMemSink->rsz_buf = NULL;
723
724         AvsysMemSink->is_rgb = FALSE;
725 }
726
727
728 /* EOF */