2 * Copyright (C) 2007 Haakon Sporsheim <hakon.sporsheim@tandberg.com>
3 * 2008 Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>
4 * 2009 Knut Inge Hvidsten <knut.inge.hvidsten@tandberg.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #include "ksvideohelpers.h"
26 #include "kshelpers.h"
28 GST_DEBUG_CATEGORY_EXTERN (gst_ks_debug);
29 #define GST_CAT_DEFAULT gst_ks_debug
31 static const GUID MEDIASUBTYPE_FOURCC =
32 { 0x0 /* FourCC here */ , 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xAA, 0x00,
36 extern const GUID MEDIASUBTYPE_I420 =
37 { 0x30323449, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B,
41 typedef struct _KsVideoDeviceEntry KsVideoDeviceEntry;
43 struct _KsVideoDeviceEntry
45 KsDeviceEntry *device;
50 ks_video_device_entry_decide_priority (KsVideoDeviceEntry * videodevice)
54 videodevice->priority = 0;
56 filter_handle = CreateFile (videodevice->device->path,
57 GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
58 FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL);
59 if (ks_is_valid_handle (filter_handle)) {
60 GUID *propsets = NULL;
63 if (ks_object_get_supported_property_sets (filter_handle, &propsets,
67 for (i = 0; i < propsets_len; i++) {
68 if (memcmp (&propsets[i], &PROPSETID_VIDCAP_CAMERACONTROL,
69 sizeof (GUID)) == 0) {
70 videodevice->priority++;
79 CloseHandle (filter_handle);
83 ks_video_device_entry_compare (gconstpointer a, gconstpointer b)
85 const KsVideoDeviceEntry *videodevice_a = a;
86 const KsVideoDeviceEntry *videodevice_b = b;
88 if (videodevice_a->priority > videodevice_b->priority)
90 else if (videodevice_a->priority == videodevice_b->priority)
97 ks_video_device_list_sort_cameras_first (GList * devices)
99 GList *videodevices = NULL, *walk;
102 for (walk = devices; walk != NULL; walk = walk->next) {
103 KsDeviceEntry *device = walk->data;
104 KsVideoDeviceEntry *videodevice;
106 videodevice = g_new (KsVideoDeviceEntry, 1);
107 videodevice->device = device;
108 ks_video_device_entry_decide_priority (videodevice);
110 videodevices = g_list_append (videodevices, videodevice);
113 videodevices = g_list_sort (videodevices, ks_video_device_entry_compare);
115 g_list_free (devices);
118 for (walk = videodevices, i = 0; walk != NULL; walk = walk->next, i++) {
119 KsVideoDeviceEntry *videodevice = walk->data;
121 videodevice->device->index = i;
122 devices = g_list_append (devices, videodevice->device);
124 g_free (videodevice);
127 g_list_free (videodevices);
132 static GstStructure *
133 ks_video_format_to_structure (GUID subtype_guid, GUID format_guid)
135 GstStructure *structure = NULL;
137 if (IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_MJPG) || IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_TVMJ) || /* FIXME: NOT tested */
138 IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_WAKE) || /* FIXME: NOT tested */
139 IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_CFCC) || /* FIXME: NOT tested */
140 IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_IJPG)) { /* FIXME: NOT tested */
141 structure = gst_structure_new ("image/jpeg", NULL);
142 } else if (IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_RGB555) || /* FIXME: NOT tested */
143 IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_RGB565) || /* FIXME: NOT tested */
144 IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_RGB24) || IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_RGB32) || /* FIXME: NOT tested */
145 IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_ARGB1555) || /* FIXME: NOT tested */
146 IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_ARGB32) || /* FIXME: NOT tested */
147 IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_ARGB4444)) { /* FIXME: NOT tested */
148 guint depth = 0, bpp = 0;
150 guint32 r_mask = 0, b_mask = 0, g_mask = 0;
152 if (IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_RGB555)) {
155 endianness = G_BIG_ENDIAN;
159 } else if (IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_RGB565)) {
161 endianness = G_BIG_ENDIAN;
165 } else if (IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_RGB24)) {
167 endianness = G_BIG_ENDIAN;
171 } else if (IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_RGB32)) {
174 endianness = G_BIG_ENDIAN;
179 *r_mask = 0xff000000;
180 *g_mask = 0x00ff0000;
181 *b_mask = 0x0000ff00;
183 } else if (IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_ARGB1555)) {
186 endianness = G_BIG_ENDIAN;
190 } else if (IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_ARGB32)) {
192 endianness = G_BIG_ENDIAN;
197 *r_mask = 0xff000000;
198 *g_mask = 0x00ff0000;
199 *b_mask = 0x0000ff00;
201 } else if (IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_ARGB4444)) {
204 endianness = G_BIG_ENDIAN;
212 g_assert_not_reached ();
215 structure = gst_structure_new ("video/x-raw-rgb",
216 "bpp", G_TYPE_INT, bpp,
217 "depth", G_TYPE_INT, depth,
218 "red_mask", G_TYPE_INT, r_mask,
219 "green_mask", G_TYPE_INT, g_mask,
220 "blue_mask", G_TYPE_INT, b_mask,
221 "endianness", G_TYPE_INT, endianness, NULL);
222 } else if (IsEqualGUID (&subtype_guid, &MEDIASUBTYPE_dvsd)) {
223 if (IsEqualGUID (&format_guid, &FORMAT_DvInfo)) {
224 structure = gst_structure_new ("video/x-dv",
225 "systemstream", G_TYPE_BOOLEAN, TRUE, NULL);
226 } else if (IsEqualGUID (&format_guid, &FORMAT_VideoInfo)) {
227 structure = gst_structure_new ("video/x-dv",
228 "systemstream", G_TYPE_BOOLEAN, FALSE,
229 "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('d', 'v', 's', 'd'),
232 } else if (memcmp (&subtype_guid.Data, &MEDIASUBTYPE_FOURCC.Data,
233 sizeof (subtype_guid) - sizeof (subtype_guid.Data1)) == 0) {
234 guint8 *p = (guint8 *) & subtype_guid.Data1;
236 structure = gst_structure_new ("video/x-raw-yuv",
237 "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC (p[0], p[1], p[2], p[3]),
242 GST_DEBUG ("Unknown DirectShow Video GUID %08x-%04x-%04x-%04x-%08x%04x",
243 subtype_guid.Data1, subtype_guid.Data, subtype_guid.Data3,
244 *(WORD *) subtype_guid.Data4, *(DWORD *) & subtype_guid.Data4[2],
245 *(WORD *) & subtype_guid.Data4[6]);
252 guess_aspect (gint width, gint height, gint * par_width, gint * par_height)
255 * As we dont have access to the actual pixel aspect, we will try to do a
256 * best-effort guess. The guess is based on most sensors being either 4/3
257 * or 16/9, and most pixel aspects being close to 1/1.
259 if ((width == 768) && (height == 448)) { /* special case for w448p */
263 if (((float) width / (float) height) < 1.2778) {
273 /* NOTE: would probably be better to use a continued fractions approach here */
275 compress_fraction (gint64 in_num, gint64 in_den, gint64 * out_num,
278 gdouble on, od, orig;
279 guint denominators[] = { 1, 2, 3, 5, 7 }, i;
280 const gdouble max_loss = 0.1;
286 for (i = 0; i < G_N_ELEMENTS (denominators); i++) {
290 cur_n = floor ((on / (od / (gdouble) denominators[i])) + 0.5);
291 cur_d = denominators[i];
292 cur = (gdouble) cur_n / (gdouble) cur_d;
293 loss = fabs (cur - orig);
295 if (loss <= max_loss) {
308 ks_video_append_video_stream_cfg_fields (GstStructure * structure,
309 const KS_VIDEO_STREAM_CONFIG_CAPS * vscc)
315 g_return_val_if_fail (structure, FALSE);
316 g_return_val_if_fail (vscc, FALSE);
319 if (vscc->MinOutputSize.cx == vscc->MaxOutputSize.cx) {
320 gst_structure_set (structure,
321 "width", G_TYPE_INT, vscc->MaxOutputSize.cx, NULL);
323 gst_structure_set (structure,
324 "width", GST_TYPE_INT_RANGE,
325 vscc->MinOutputSize.cx, vscc->MaxOutputSize.cx, NULL);
329 if (vscc->MinOutputSize.cy == vscc->MaxOutputSize.cy) {
330 gst_structure_set (structure,
331 "height", G_TYPE_INT, vscc->MaxOutputSize.cy, NULL);
333 gst_structure_set (structure,
334 "height", GST_TYPE_INT_RANGE,
335 vscc->MinOutputSize.cy, vscc->MaxOutputSize.cy, NULL);
339 compress_fraction (NANOSECONDS, vscc->MinFrameInterval, &min_n, &min_d);
340 compress_fraction (NANOSECONDS, vscc->MaxFrameInterval, &max_n, &max_d);
342 if (min_n == max_n && min_d == max_d) {
343 g_value_init (&val, GST_TYPE_FRACTION);
344 gst_value_set_fraction (&val, max_n, max_d);
346 g_value_init (&val, GST_TYPE_FRACTION_RANGE);
347 gst_value_set_fraction_range_full (&val, max_n, max_d, min_n, min_d);
350 gst_structure_set_value (structure, "framerate", &val);
351 g_value_unset (&val);
354 gint par_width, par_height;
356 guess_aspect (vscc->MaxOutputSize.cx, vscc->MaxOutputSize.cy,
357 &par_width, &par_height);
359 gst_structure_set (structure,
360 "pixel-aspect-ratio", GST_TYPE_FRACTION, par_width, par_height, NULL);
367 ks_video_media_type_dup (KsVideoMediaType * media_type)
369 KsVideoMediaType *result = g_new (KsVideoMediaType, 1);
371 memcpy (result, media_type, sizeof (KsVideoMediaType));
373 result->range = g_malloc (media_type->range->FormatSize);
374 memcpy ((gpointer) result->range, media_type->range,
375 media_type->range->FormatSize);
377 result->format = g_malloc (media_type->format_size);
378 memcpy (result->format, media_type->format, media_type->format_size);
380 result->translated_caps = gst_caps_ref (media_type->translated_caps);
386 ks_video_media_type_free (KsVideoMediaType * media_type)
388 if (media_type == NULL)
391 g_free ((gpointer) media_type->range);
393 g_free (media_type->format);
395 if (media_type->translated_caps != NULL)
396 gst_caps_unref (media_type->translated_caps);
402 ks_video_media_type_list_remove_duplicates (GList * media_types)
404 GList *master, *duplicates;
409 master = duplicates = NULL;
411 /* Find the first set of duplicates and their master */
412 for (entry = media_types; entry != NULL && duplicates == NULL;
413 entry = entry->next) {
414 KsVideoMediaType *mt = entry->data;
417 for (other_entry = media_types; other_entry != NULL;
418 other_entry = other_entry->next) {
419 KsVideoMediaType *other_mt = other_entry->data;
424 if (gst_caps_is_equal (mt->translated_caps, other_mt->translated_caps))
425 duplicates = g_list_prepend (duplicates, other_mt);
428 if (duplicates != NULL)
432 if (duplicates != NULL) {
433 KsVideoMediaType *selected_mt = master->data;
436 * Pick a FORMAT_VideoInfo2 if present, if not we just stay with the
439 for (entry = duplicates; entry != NULL; entry = entry->next) {
440 KsVideoMediaType *mt = entry->data;
442 if (IsEqualGUID (&mt->range->Specifier, &FORMAT_VideoInfo2)) {
443 ks_video_media_type_free (selected_mt);
446 ks_video_media_type_free (mt);
449 /* Remove the dupe from the main list */
450 media_types = g_list_remove (media_types, mt);
453 /* Update master node with the selected MediaType */
454 master->data = selected_mt;
456 g_list_free (duplicates);
459 while (master != NULL);
465 ks_video_probe_filter_for_caps (HANDLE filter_handle)
471 if (!ks_filter_get_pin_property (filter_handle, 0, KSPROPSETID_Pin,
472 KSPROPERTY_PIN_CTYPES, &pin_count, sizeof (pin_count), NULL))
475 GST_DEBUG ("pin_count = %d", pin_count);
477 for (pin_id = 0; pin_id < pin_count; pin_id++) {
478 KSPIN_COMMUNICATION pin_comm;
479 KSPIN_DATAFLOW pin_flow;
482 if (!ks_filter_get_pin_property (filter_handle, pin_id, KSPROPSETID_Pin,
483 KSPROPERTY_PIN_COMMUNICATION, &pin_comm, sizeof (pin_comm), NULL))
486 if (!ks_filter_get_pin_property (filter_handle, pin_id, KSPROPSETID_Pin,
487 KSPROPERTY_PIN_DATAFLOW, &pin_flow, sizeof (pin_flow), NULL))
490 if (!ks_filter_get_pin_property (filter_handle, pin_id, KSPROPSETID_Pin,
491 KSPROPERTY_PIN_CATEGORY, &pin_cat, sizeof (pin_cat), NULL))
494 GST_DEBUG ("pin[%u]: pin_comm=%d, pin_flow=%d", pin_id, pin_comm, pin_flow);
496 if (pin_flow == KSPIN_DATAFLOW_OUT &&
497 memcmp (&pin_cat, &PINNAME_CAPTURE, sizeof (GUID)) == 0) {
498 KSMULTIPLE_ITEM *items;
500 if (ks_filter_get_pin_property_multi (filter_handle, pin_id,
501 KSPROPSETID_Pin, KSPROPERTY_PIN_DATARANGES, &items, NULL)) {
502 KSDATARANGE *range = (KSDATARANGE *) (items + 1);
505 for (i = 0; i < items->Count; i++) {
506 if (IsEqualGUID (&range->MajorFormat, &KSDATAFORMAT_TYPE_VIDEO)) {
507 KsVideoMediaType *entry;
508 gpointer src_vscc, src_format;
509 GstStructure *media_structure;
511 entry = g_new0 (KsVideoMediaType, 1);
512 entry->pin_id = pin_id;
514 entry->range = g_malloc (range->FormatSize);
515 memcpy ((gpointer) entry->range, range, range->FormatSize);
517 if (IsEqualGUID (&range->Specifier, &FORMAT_VideoInfo)) {
518 KS_DATARANGE_VIDEO *vr = (KS_DATARANGE_VIDEO *) entry->range;
520 src_vscc = &vr->ConfigCaps;
521 src_format = &vr->VideoInfoHeader;
523 entry->format_size = sizeof (vr->VideoInfoHeader);
524 entry->sample_size = vr->VideoInfoHeader.bmiHeader.biSizeImage;
525 } else if (IsEqualGUID (&range->Specifier, &FORMAT_VideoInfo2)) {
526 KS_DATARANGE_VIDEO2 *vr = (KS_DATARANGE_VIDEO2 *) entry->range;
528 src_vscc = &vr->ConfigCaps;
529 src_format = &vr->VideoInfoHeader;
531 entry->format_size = sizeof (vr->VideoInfoHeader);
532 entry->sample_size = vr->VideoInfoHeader.bmiHeader.biSizeImage;
533 } else if (IsEqualGUID (&range->Specifier, &FORMAT_MPEGVideo)) {
534 /* Untested and probably wrong... */
535 KS_DATARANGE_MPEG1_VIDEO *vr =
536 (KS_DATARANGE_MPEG1_VIDEO *) entry->range;
538 src_vscc = &vr->ConfigCaps;
539 src_format = &vr->VideoInfoHeader;
541 entry->format_size = sizeof (vr->VideoInfoHeader);
543 vr->VideoInfoHeader.hdr.bmiHeader.biSizeImage;
544 } else if (IsEqualGUID (&range->Specifier, &FORMAT_MPEG2Video)) {
545 /* Untested and probably wrong... */
546 KS_DATARANGE_MPEG2_VIDEO *vr =
547 (KS_DATARANGE_MPEG2_VIDEO *) entry->range;
549 src_vscc = &vr->ConfigCaps;
550 src_format = &vr->VideoInfoHeader;
552 entry->format_size = sizeof (vr->VideoInfoHeader);
554 vr->VideoInfoHeader.hdr.bmiHeader.biSizeImage;
558 guid_str = ks_guid_to_string (&range->Specifier);
559 GST_DEBUG ("pin[%u]: ignoring unknown specifier GUID %s",
563 ks_video_media_type_free (entry);
568 g_assert (entry->sample_size != 0);
570 memcpy ((gpointer) & entry->vscc, src_vscc, sizeof (entry->vscc));
572 entry->format = g_malloc (entry->format_size);
573 memcpy (entry->format, src_format, entry->format_size);
576 ks_video_format_to_structure (range->SubFormat,
579 if (media_structure == NULL) {
580 g_warning ("ks_video_format_to_structure returned NULL");
581 ks_video_media_type_free (entry);
583 } else if (ks_video_append_video_stream_cfg_fields
584 (media_structure, &entry->vscc)) {
585 entry->translated_caps = gst_caps_new_empty ();
586 gst_caps_append_structure (entry->translated_caps,
589 gst_structure_free (media_structure);
590 ks_video_media_type_free (entry);
595 ret = g_list_prepend (ret, entry);
599 /* REVISIT: Each KSDATARANGE should start on a 64-bit boundary */
600 range = (KSDATARANGE *) (((guchar *) range) + range->FormatSize);
609 ret = g_list_reverse (ret);
610 ret = ks_video_media_type_list_remove_duplicates (ret);
618 ks_video_create_pin_conn_from_media_type (KsVideoMediaType * media_type)
620 KSPIN_CONNECT *conn = NULL;
621 KSDATAFORMAT *format = NULL;
624 conn = g_malloc0 (sizeof (KSPIN_CONNECT) + sizeof (KSDATAFORMAT) +
625 media_type->format_size);
627 conn->Interface.Set = KSINTERFACESETID_Standard;
628 conn->Interface.Id = KSINTERFACE_STANDARD_STREAMING;
629 conn->Interface.Flags = 0;
631 conn->Medium.Set = KSMEDIUMSETID_Standard;
632 conn->Medium.Id = KSMEDIUM_TYPE_ANYINSTANCE;
633 conn->Medium.Flags = 0;
635 conn->PinId = media_type->pin_id;
636 conn->PinToHandle = NULL;
637 conn->Priority.PriorityClass = KSPRIORITY_NORMAL;
638 conn->Priority.PrioritySubClass = KSPRIORITY_NORMAL;
640 format = (KSDATAFORMAT *) (conn + 1);
641 memcpy (format, media_type->range, sizeof (KSDATAFORMAT));
642 format->FormatSize = sizeof (KSDATAFORMAT) + media_type->format_size;
644 vih = (guint8 *) (format + 1);
645 memcpy (vih, media_type->format, media_type->format_size);
651 ks_video_fixate_media_type (const KSDATARANGE * range,
652 guint8 * format, gint width, gint height, gint fps_n, gint fps_d)
654 KS_DATARANGE_VIDEO *vr;
655 KS_VIDEOINFOHEADER *vih;
656 KS_BITMAPINFOHEADER *bih;
659 g_return_val_if_fail (format != NULL, FALSE);
661 if (IsEqualGUID (&range->Specifier, &FORMAT_VideoInfo)) {
662 bih = &((KS_VIDEOINFOHEADER *) format)->bmiHeader;
663 } else if (IsEqualGUID (&range->Specifier, &FORMAT_VideoInfo2)) {
664 bih = &((KS_VIDEOINFOHEADER2 *) format)->bmiHeader;
665 } else if (IsEqualGUID (&range->Specifier, &FORMAT_MPEGVideo)) {
666 bih = &((KS_MPEG1VIDEOINFO *) format)->hdr.bmiHeader;
667 } else if (IsEqualGUID (&range->Specifier, &FORMAT_MPEG2Video)) {
668 bih = &((KS_MPEGVIDEOINFO2 *) format)->hdr.bmiHeader;
673 /* These formats' structures share the most basic stuff */
674 vr = (KS_DATARANGE_VIDEO *) range;
675 vih = (KS_VIDEOINFOHEADER *) format;
677 /* FIXME: Need to figure out how to properly handle ranges */
678 if (bih->biWidth != width || bih->biHeight != height)
681 /* Framerate, clamped because of fraction conversion rounding errors */
682 vih->AvgTimePerFrame =
683 gst_util_uint64_scale_int_round (NANOSECONDS, fps_d, fps_n);
684 vih->AvgTimePerFrame =
685 MAX (vih->AvgTimePerFrame, vr->ConfigCaps.MinFrameInterval);
686 vih->AvgTimePerFrame =
687 MIN (vih->AvgTimePerFrame, vr->ConfigCaps.MaxFrameInterval);
689 /* Bitrate, clamped for the same reason as framerate */
690 dwRate = (width * height * fps_n) / fps_d;
691 vih->dwBitRate = dwRate * bih->biBitCount;
692 vih->dwBitRate = MAX (vih->dwBitRate, vr->ConfigCaps.MinBitsPerSecond);
693 vih->dwBitRate = MIN (vih->dwBitRate, vr->ConfigCaps.MaxBitsPerSecond);
698 static GstStructure *
699 ks_video_append_var_video_fields (GstStructure * structure)
702 gst_structure_set (structure,
703 "width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
704 "height", GST_TYPE_INT_RANGE, 1, G_MAXINT,
705 "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
712 ks_video_get_all_caps (void)
714 static GstCaps *caps = NULL;
717 GstStructure *structure;
718 caps = gst_caps_new_empty ();
720 /* from Windows SDK 6.0 uuids.h */
723 ks_video_append_var_video_fields (ks_video_format_to_structure
724 (MEDIASUBTYPE_RGB555, FORMAT_VideoInfo));
725 gst_caps_append_structure (caps, structure);
728 ks_video_append_var_video_fields (ks_video_format_to_structure
729 (MEDIASUBTYPE_RGB565, FORMAT_VideoInfo));
730 gst_caps_append_structure (caps, structure);
733 ks_video_append_var_video_fields (ks_video_format_to_structure
734 (MEDIASUBTYPE_RGB24, FORMAT_VideoInfo));
735 gst_caps_append_structure (caps, structure);
738 ks_video_append_var_video_fields (ks_video_format_to_structure
739 (MEDIASUBTYPE_RGB32, FORMAT_VideoInfo));
740 gst_caps_append_structure (caps, structure);
744 ks_video_append_var_video_fields (gst_structure_new ("video/x-raw-yuv",
746 gst_caps_append_structure (caps, structure);
750 ks_video_append_var_video_fields (ks_video_format_to_structure
751 (MEDIASUBTYPE_MJPG, FORMAT_VideoInfo));
752 gst_caps_append_structure (caps, structure);
755 ks_video_append_var_video_fields (ks_video_format_to_structure
756 (MEDIASUBTYPE_dvsd, FORMAT_VideoInfo));
757 gst_caps_append_structure (caps, structure);
759 structure = /* no variable video fields (width, height, framerate) */
760 ks_video_format_to_structure (MEDIASUBTYPE_dvsd, FORMAT_DvInfo);
761 gst_caps_append_structure (caps, structure);