After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 703076 - flvdemux: Add flvversion 1 to flash-video caps
flvdemux: Add flvversion 1 to flash-video caps
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.0.8
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-25 19:56 UTC by Alban Browaeys
Modified: 2013-07-05 19:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
flvdemux: add flvversion 1 to src - allow using avdec_flv (2.47 KB, patch)
2013-06-25 19:56 UTC, Alban Browaeys
committed Details | Review

Description Alban Browaeys 2013-06-25 19:56:42 UTC
Created attachment 247771 [details] [review]
flvdemux: add flvversion 1 to src - allow using avdec_flv

flv current only support flvversion 1.
    
    avdec_flv set flvversion as 1 on its sink. But flvdemux does not.
    So in gst_element_factory_list_filter when the caps are checked if
    is_subset of the avdec_flv sink template capabilities, the check fails.
    
    NB: gst_caps_is_subset relies on gst_structure_is_subset. The latter
    fails if the superset has more fields than the subset (and even if that
    condition is removed latter fails in gst_caps_structure_is_superset_field
    if a field of the superset is not in the subset -
    but gst_caps_structure_is_superset_field also check that the subset
    value is a "subset" of the superset adhoc field value, so it is not
    as simple as switching superset and subset identifiers).
    
    With above nota bene diagnosis I hope it makes more sense.

NB2: in 0.10 flv sorenson works without this patch .

The attached patch let flv1 (here sorenson spark) play via gstreamer (gst-launch-1.0 and totem ).
It adds flvversion=1 field to flvdemux when it outputs x-flash-video.

ext/libav/gstavcodecmap.c:1008
caps =
          gst_ff_vid_caps_new (context, NULL, codec_id, encode,
          "video/x-flash-video", "flvversion", G_TYPE_INT, 1, NULL);


listing:
844	    templates = gst_element_factory_get_static_pad_templates (factory);
845	    for (walk = (GList *) templates; walk; walk = g_list_next (walk)) {
846	      GstStaticPadTemplate *templ = walk->data;
847	
848	      /* we only care about the sink templates */
849	      if (templ->direction == direction) {
850	        GstCaps *tmpl_caps;
851	
852	        /* try to intersect the caps with the caps of the template */
853	        tmpl_caps = gst_static_caps_get (&templ->static_caps);
(gdb) l
854	
855	        /* FIXME, intersect is not the right method, we ideally want to check
856	         * for a subset here */
857	
858	        /* check if the intersection is empty */
859	        if ((subsetonly && gst_caps_is_subset (caps, tmpl_caps)) ||
860	            (!subsetonly && gst_caps_can_intersect (caps, tmpl_caps))) {
861	          /* non empty intersection, we can use this element */
862	          g_queue_push_tail (&results, gst_object_ref (factory));



backtrace gst 1.0:

Breakpoint 3, gst_element_factory_list_filter (list=0x89fc40 = {...}, caps=0x7fffe401bb20, direction=GST_PAD_SINK, subsetonly=1)
    at gstelementfactory.c:844
844	    templates = gst_element_factory_get_static_pad_templates (factory);
(gdb) p *factory
$4 = {parent = {object = {object = {g_type_instance = {g_class = 0x6102a0}, ref_count = 6, qdata = 0x0}, lock = {p = 0x6c99b0, i = {7117232, 0}}, 
      name = 0x6c99e0 "avdec_flv", parent = 0x61b070, flags = 0, control_bindings = 0x0, control_rate = 100000000, last_sync = 18446744073709551615, 
      _gst_reserved = 0x0}, loaded = 0, rank = 64, plugin_name = 0x683410 "libav", plugin = 0x67b810, _gst_reserved = {0x0, 0x0, 0x0, 0x0}}, 
  type = 0, metadata = 0x6ca9a0, staticpadtemplates = 0x6caa00 = {0x6c9240, 0x6c9280}, numpadtemplates = 2, uri_type = GST_URI_UNKNOWN, 
  uri_protocols = 0x0, interfaces = 0x0, _gst_reserved = {0x0, 0x0, 0x0, 0x0}}

(gdb) p g_quark_to_string(((((GstCapsArrayElement *)((GstCapsImpl *)tmpl_caps)->array.data)[0]).structure).name)
$20 = (const gchar *) 0x7fffe4004cbd "video/x-flash-video"
(gdb) p g_quark_to_string(((((GstCapsArrayElement *)((GstCapsImpl *)caps)->array.data)[0]).structure).name)
$21 = (const gchar *) 0x64d067 "video/x-flv"
(gdb) p gst_structure_n_fields(((((GstCapsArrayElement *)((GstCapsImpl *)tmpl_caps)->array.data)[0]).structure))$22 = 1
(gdb) p gst_structure_n_fields(((((GstCapsArrayElement *)((GstCapsImpl *)caps)->array.data)[0]).structure))
$23 = 0
(gdb) p g_quark_to_string(((GstStructureField *)((GstStructureImpl *)((((GstCapsArrayElement *)((GstCapsImpl *)tmpl_caps)->array.data)[0]).structure))->fields->data)[0].name)




$24 = (const gchar *) 0x7fffe4004cd1 "flvversion"
  • #0 gst_element_factory_list_filter
    at gstelementfactory.c line 859
  • #1 autoplug_factories_cb
    at gstplaybin2.c line 3817
  • #2 ffi_call_unix64
    at ../src/x86/unix64.S line 76
  • #3 ffi_call
    at ../src/x86/ffi64.c line 522
  • #4 g_cclosure_marshal_generic
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/gobject/gclosure.c line 1454
  • #5 g_closure_invoke
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/gobject/gclosure.c line 777
  • #6 signal_emit_unlocked_R
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/gobject/gsignal.c line 3582
  • #7 g_signal_emit_valist
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/gobject/gsignal.c line 3336
  • #8 g_signal_emit
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/gobject/gsignal.c line 3382
  • #9 proxy_autoplug_factories_signal
    at gsturidecodebin.c line 1675
  • #10 ffi_call_unix64
    at ../src/x86/unix64.S line 76
  • #11 ffi_call
    at ../src/x86/ffi64.c line 522
  • #12 g_cclosure_marshal_generic
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/gobject/gclosure.c line 1454
  • #13 g_closure_invoke
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/gobject/gclosure.c line 777
  • #14 signal_emit_unlocked_R
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/gobject/gsignal.c line 3582
  • #15 g_signal_emit_valist
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/gobject/gsignal.c line 3336
  • #16 g_signal_emit
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/gobject/gsignal.c line 3382
  • #17 analyze_new_pad
    at gstdecodebin2.c line 1549
  • #18 type_found
    at gstdecodebin2.c line 2471
  • #19 ffi_call_unix64
    at ../src/x86/unix64.S line 76
  • #20 ffi_call
    at ../src/x86/ffi64.c line 522
  • #21 g_cclosure_marshal_generic
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/gobject/gclosure.c line 1454
  • #22 g_closure_invoke
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/gobject/gclosure.c line 777
  • #23 signal_emit_unlocked_R
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/gobject/gsignal.c line 3582
  • #24 g_signal_emit_valist
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/gobject/gsignal.c line 3326
  • #25 g_signal_emit
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/gobject/gsignal.c line 3382
  • #26 gst_type_find_element_setcaps
    at gsttypefindelement.c line 714
  • #27 gst_type_find_element_sink_event
    at gsttypefindelement.c line 618
  • #28 gst_pad_send_event_unchecked
    at gstpad.c line 4983
  • #29 gst_pad_push_event_unchecked
    at gstpad.c line 4679
  • #30 push_sticky
    at gstpad.c line 3318
  • #31 events_foreach
    at gstpad.c line 530
  • #32 check_sticky
    at gstpad.c line 3374
  • #33 gst_pad_push_event
    at gstpad.c line 4796
  • #34 event_forward_func
    at gstpad.c line 2735
  • #35 gst_pad_forward
    at gstpad.c line 2689
  • #36 gst_pad_event_default
    at gstpad.c line 2786
  • #37 gst_pad_send_event_unchecked
    at gstpad.c line 4983
  • #38 gst_pad_push_event_unchecked
    at gstpad.c line 4679
  • #39 push_sticky
    at gstpad.c line 3318
  • #40 events_foreach
    at gstpad.c line 530
  • #41 check_sticky
    at gstpad.c line 3374
  • #42 gst_pad_push_event
    at gstpad.c line 4796
  • #43 gst_queue2_push_one
    at gstqueue2.c line 2584
  • #44 gst_queue2_loop
    at gstqueue2.c line 2670
  • #45 gst_task_func
    at gsttask.c line 316
  • #46 default_func
    at gsttaskpool.c line 70
  • #47 g_thread_pool_thread_proxy
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/gthreadpool.c line 309
  • #48 g_thread_proxy
    at /home/prahal/Projects/Devel/Gnome/jhbuild/gnome/glib/glib/gthread.c line 798
  • #49 start_thread
    at pthread_create.c line 311
  • #50 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 113

Comment 1 Sebastian Dröge (slomo) 2013-07-01 09:46:26 UTC
commit 97015d3c93e26f6e5522fbd70b3f26d300cb71ef
Author: Alban Browaeys <prahal@yahoo.com>
Date:   Tue Jun 25 21:16:38 2013 +0200

    flvdemux: Add flvversion 1 to the flash-video caps
    
    This allows using avdec_flv which requires this field to be
    present in the caps. FLV only supports flash-video version 1
    right now.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=703076
Comment 2 Tim-Philipp Müller 2013-07-05 19:03:36 UTC
Cherry-picked this into 1.0 as well.