Merge remote-tracking branch 'origin/master' into 0.11
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 2 Dec 2011 00:07:39 +0000 (00:07 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 2 Dec 2011 00:07:39 +0000 (00:07 +0000)
Conflicts:
ext/alsa/gstalsasrc.c
ext/alsa/gstalsasrc.h
gst/adder/gstadder.c
gst/playback/gstplaybin2.c
gst/playback/gstplaysinkconvertbin.c
win32/common/libgstvideo.def

1  2 
docs/libs/gst-plugins-base-libs-sections.txt
ext/alsa/gstalsasrc.c
ext/ogg/gstoggdemux.c
gst-libs/gst/video/video.c
gst-libs/gst/video/video.h
gst/playback/gstplaybin2.c
gst/playback/gstplaysinkconvertbin.c
tests/check/elements/audioresample.c
win32/common/libgstvideo.def

@@@ -2095,18 -2202,111 +2095,23 @@@ GstEncodingTargetClas
  <SECTION>
  <FILE>gstvideo</FILE>
  <INCLUDE>gst/video/video.h</INCLUDE>
 -GST_VIDEO_BLUE_MASK_15
 -GST_VIDEO_BLUE_MASK_15_INT
 -GST_VIDEO_BLUE_MASK_16
 -GST_VIDEO_BLUE_MASK_16_INT
 -GST_VIDEO_BYTE1_MASK_24
 -GST_VIDEO_BYTE1_MASK_24_INT
 -GST_VIDEO_BYTE1_MASK_32
 -GST_VIDEO_BYTE1_MASK_32_INT
 -GST_VIDEO_BYTE2_MASK_24
 -GST_VIDEO_BYTE2_MASK_24_INT
 -GST_VIDEO_BYTE2_MASK_32
 -GST_VIDEO_BYTE2_MASK_32_INT
 -GST_VIDEO_BYTE3_MASK_24
 -GST_VIDEO_BYTE3_MASK_24_INT
 -GST_VIDEO_BYTE3_MASK_32
 -GST_VIDEO_BYTE3_MASK_32_INT
 -GST_VIDEO_BYTE4_MASK_32
 -GST_VIDEO_BYTE4_MASK_32_INT
 -GST_VIDEO_CAPS_ABGR
 -GST_VIDEO_CAPS_ARGB
 -GST_VIDEO_CAPS_BGR
 -GST_VIDEO_CAPS_BGRA
 -GST_VIDEO_CAPS_BGRx
 -GST_VIDEO_CAPS_BGRx_HOST_ENDIAN
 -GST_VIDEO_CAPS_RGB
 -GST_VIDEO_CAPS_RGBA
 -GST_VIDEO_CAPS_RGB_15
 -GST_VIDEO_CAPS_RGB_16
 -GST_VIDEO_CAPS_RGBx
 -GST_VIDEO_CAPS_YUV
 -GST_VIDEO_CAPS_xBGR
 -GST_VIDEO_CAPS_xRGB
 -GST_VIDEO_CAPS_xRGB_HOST_ENDIAN
 -GST_VIDEO_CAPS_BGR_15
 -GST_VIDEO_CAPS_BGR_16
 -GST_VIDEO_CAPS_RGB8_PALETTED
 -GST_VIDEO_CAPS_GRAY8
 -GST_VIDEO_CAPS_GRAY16
 -GST_VIDEO_CAPS_ARGB_64
 -GST_VIDEO_CAPS_r210
 -GST_VIDEO_COMP1_MASK_15
 -GST_VIDEO_COMP1_MASK_15_INT
 -GST_VIDEO_COMP1_MASK_16
 -GST_VIDEO_COMP1_MASK_16_INT
 -GST_VIDEO_COMP2_MASK_15
 -GST_VIDEO_COMP2_MASK_15_INT
 -GST_VIDEO_COMP2_MASK_16
 -GST_VIDEO_COMP2_MASK_16_INT
 -GST_VIDEO_COMP3_MASK_15
 -GST_VIDEO_COMP3_MASK_15_INT
 -GST_VIDEO_COMP3_MASK_16
 -GST_VIDEO_COMP3_MASK_16_INT
  GST_VIDEO_FPS_RANGE
 -GST_VIDEO_GREEN_MASK_15
 -GST_VIDEO_GREEN_MASK_15_INT
 -GST_VIDEO_GREEN_MASK_16
 -GST_VIDEO_GREEN_MASK_16_INT
 -GST_VIDEO_RED_MASK_15
 -GST_VIDEO_RED_MASK_15_INT
 -GST_VIDEO_RED_MASK_16
 -GST_VIDEO_RED_MASK_16_INT
  GST_VIDEO_SIZE_RANGE
 -GST_VIDEO_BUFFER_TFF
 -GST_VIDEO_BUFFER_RFF
 -GST_VIDEO_BUFFER_ONEFIELD
 -GST_VIDEO_BUFFER_PROGRESSIVE
  GstVideoFormat
  gst_video_calculate_display_ratio
 -gst_video_frame_rate
 -gst_video_get_size
 -gst_video_get_size_from_caps
 -gst_video_format_convert
 -gst_video_format_new_caps
 -gst_video_format_new_caps_interlaced
 -gst_video_format_new_template_caps
 -gst_video_format_get_component_height
 -gst_video_format_get_component_offset
 -gst_video_format_get_component_width
 -gst_video_format_get_component_depth
 -gst_video_format_get_pixel_stride
 -gst_video_format_get_row_stride
 -gst_video_format_get_size
 -gst_video_format_has_alpha
 -gst_video_format_is_rgb
 -gst_video_format_is_gray
 -gst_video_format_is_yuv
  gst_video_format_to_fourcc
  gst_video_format_from_fourcc
 -gst_video_format_parse_caps
 -gst_video_format_parse_caps_interlaced
 -gst_video_parse_caps_framerate
 -gst_video_parse_caps_pixel_aspect_ratio
 -gst_video_parse_caps_color_matrix
 -gst_video_parse_caps_chroma_site
  gst_video_parse_caps_palette
 -GstVideoConvertFrameCallback
 -gst_video_convert_frame
 -gst_video_convert_frame_async
 +GstVideoConvertSampleCallback
 +gst_video_convert_sample
 +gst_video_convert_sample_async
  gst_video_event_new_still_frame
  gst_video_event_parse_still_frame
+ gst_video_event_new_upstream_force_key_unit
+ gst_video_event_new_downstream_force_key_unit
+ gst_video_event_is_force_key_unit
+ gst_video_event_parse_upstream_force_key_unit
+ gst_video_event_parse_downstream_force_key_unit
  <SUBSECTION Standard>
  gst_video_format_get_type
  GST_TYPE_VIDEO_FORMAT
@@@ -157,17 -210,7 +151,14 @@@ gst_alsasrc_class_init (GstAlsaSrcClas
    gobject_class->get_property = gst_alsasrc_get_property;
    gobject_class->set_property = gst_alsasrc_set_property;
  
-   gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_alsasrc_change_state);
 +  gst_element_class_set_details_simple (gstelement_class,
 +      "Audio source (ALSA)", "Source/Audio",
 +      "Read from a sound card via ALSA", "Wim Taymans <wim@fluendo.com>");
 +
 +  gst_element_class_add_pad_template (gstelement_class,
 +      gst_static_pad_template_get (&alsasrc_src_factory));
 +
    gstbasesrc_class->get_caps = GST_DEBUG_FUNCPTR (gst_alsasrc_getcaps);
-   gstbasesrc_class->create = GST_DEBUG_FUNCPTR (gst_alsasrc_create);
  
    gstaudiosrc_class->open = GST_DEBUG_FUNCPTR (gst_alsasrc_open);
    gstaudiosrc_class->prepare = GST_DEBUG_FUNCPTR (gst_alsasrc_prepare);
@@@ -324,61 -286,8 +234,8 @@@ gst_alsasrc_get_property (GObject * obj
    }
  }
  
- static GstStateChangeReturn
- gst_alsasrc_change_state (GstElement * element, GstStateChange transition)
- {
-   GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
-   GstAudioBaseSrc *src = GST_AUDIO_BASE_SRC (element);
-   GstAlsaSrc *asrc = GST_ALSA_SRC (element);
-   GstClock *clk;
-   switch (transition) {
-       /* Show the compiler that we care */
-     case GST_STATE_CHANGE_NULL_TO_READY:
-     case GST_STATE_CHANGE_READY_TO_PAUSED:
-     case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
-     case GST_STATE_CHANGE_PAUSED_TO_READY:
-     case GST_STATE_CHANGE_READY_TO_NULL:
-       break;
-     case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
-       clk = src->clock;
-       asrc->driver_timestamps = FALSE;
-       if (GST_IS_SYSTEM_CLOCK (clk)) {
-         gint clocktype;
-         g_object_get (clk, "clock-type", &clocktype, NULL);
-         if (clocktype == GST_CLOCK_TYPE_MONOTONIC) {
-           asrc->driver_timestamps = TRUE;
-         }
-       }
-       break;
-   }
-   ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
-   return ret;
- }
- static GstFlowReturn
- gst_alsasrc_create (GstBaseSrc * bsrc, guint64 offset, guint length,
-     GstBuffer ** outbuf)
- {
-   GstFlowReturn ret = GST_FLOW_OK;
-   GstAlsaSrc *asrc = GST_ALSA_SRC (bsrc);
-   ret =
-       GST_BASE_SRC_CLASS (parent_class)->create (bsrc, offset, length, outbuf);
-   if (asrc->driver_timestamps == TRUE && *outbuf) {
-     GstClockTime ts = gst_alsasrc_get_timestamp (asrc);
-     if (GST_CLOCK_TIME_IS_VALID (ts)) {
-       GST_BUFFER_TIMESTAMP (*outbuf) = ts;
-     }
-   }
-   return ret;
- }
  static void
 -gst_alsasrc_init (GstAlsaSrc * alsasrc, GstAlsaSrcClass * g_class)
 +gst_alsasrc_init (GstAlsaSrc * alsasrc)
  {
    GST_DEBUG_OBJECT (alsasrc, "initializing");
  
Simple merge
Simple merge
@@@ -704,15 -552,40 +704,40 @@@ GstEvent *     gst_video_event_new_stil
  
  gboolean       gst_video_event_parse_still_frame (GstEvent * event, gboolean * in_still);
  
+ /* video force key unit event creation and parsing */
+ GstEvent * gst_video_event_new_downstream_force_key_unit (GstClockTime timestamp,
+                                                           GstClockTime streamtime,
+                                                           GstClockTime runningtime,
+                                                           gboolean all_headers,
+                                                           guint count);
+ gboolean gst_video_event_parse_downstream_force_key_unit (GstEvent * event,
+                                                           GstClockTime * timestamp,
+                                                           GstClockTime * streamtime,
+                                                           GstClockTime * runningtime,
+                                                           gboolean * all_headers,
+                                                           guint * count);
+ GstEvent * gst_video_event_new_upstream_force_key_unit (GstClockTime running_time,
+                                                         gboolean all_headers,
+                                                         guint count);
+ gboolean gst_video_event_parse_upstream_force_key_unit (GstEvent * event,
+                                                         GstClockTime * running_time,
+                                                         gboolean * all_headers,
+                                                         guint * count);
+ gboolean gst_video_event_is_force_key_unit(GstEvent *event);
  
 -/* convert/encode video frame from one format to another */
 +/* convert/encode video sample from one format to another */
  
 -typedef void (*GstVideoConvertFrameCallback) (GstBuffer * buf, GError *error, gpointer user_data);
 +typedef void (*GstVideoConvertSampleCallback) (GstSample * sample, GError *error, gpointer user_data);
  
 -void           gst_video_convert_frame_async (GstBuffer                    * buf,
 +void          gst_video_convert_sample_async (GstSample                    * sample,
                                                const GstCaps                * to_caps,
                                                GstClockTime                   timeout,
 -                                              GstVideoConvertFrameCallback   callback,
 +                                              GstVideoConvertSampleCallback  callback,
                                                gpointer                       user_data,
                                                GDestroyNotify                 destroy_notify);
  
@@@ -3294,9 -3290,34 +3299,34 @@@ autoplug_select_cb (GstElement * decode
          sink = group->video_sink;
  
        if ((sinkpad = gst_element_get_static_pad (sink, "sink"))) {
 -        caps = gst_pad_get_caps_reffed (sinkpad);
+         GstPlayFlags flags = gst_play_bin_get_flags (playbin);
+         GstCaps *raw_caps =
+             (isaudiodec) ? gst_static_caps_get (&raw_audio_caps) :
+             gst_static_caps_get (&raw_video_caps);
 +        caps = gst_pad_query_caps (sinkpad, NULL);
  
-         compatible = gst_element_factory_can_src_any_caps (factory, caps);
+         /* If the sink supports raw audio/video, we first check
+          * if the decoder could output any raw audio/video format
+          * and assume it is compatible with the sink then. We don't
+          * do a complete compatibility check here if converters
+          * are plugged between the decoder and the sink because
+          * the converters will convert between raw formats and
+          * even if the decoder format is not supported by the decoder
+          * a converter will convert it.
+          *
+          * We assume here that the converters can convert between
+          * any raw format.
+          */
+         if ((isaudiodec && !(flags & GST_PLAY_FLAG_NATIVE_AUDIO)
+                 && gst_caps_can_intersect (caps, raw_caps)) || (!isaudiodec
+                 && !(flags & GST_PLAY_FLAG_NATIVE_VIDEO)
+                 && gst_caps_can_intersect (caps, raw_caps))) {
+           compatible = gst_element_factory_can_src_any_caps (factory, raw_caps)
+               || gst_element_factory_can_src_any_caps (factory, caps);
+         } else {
+           compatible = gst_element_factory_can_src_any_caps (factory, caps);
+         }
  
          gst_object_unref (sinkpad);
          gst_caps_unref (caps);
@@@ -85,10 -82,20 +85,12 @@@ distribute_running_time (GstElement * e
    pad = gst_element_get_static_pad (element, "sink");
  
    gst_pad_send_event (pad, gst_event_new_flush_start ());
 -  gst_pad_send_event (pad, gst_event_new_flush_stop ());
 -
 -  if (segment->accum && segment->format != GST_FORMAT_UNDEFINED) {
 -    event = gst_event_new_new_segment_full (FALSE, segment->rate,
 -        segment->applied_rate, segment->format, 0, segment->accum, 0);
 -    gst_pad_send_event (pad, event);
 -  }
 +  gst_pad_send_event (pad, gst_event_new_flush_stop (FALSE));
  
-   event = gst_event_new_segment (segment);
-   gst_pad_send_event (pad, event);
+   if (segment->format != GST_FORMAT_UNDEFINED) {
 -    event = gst_event_new_new_segment_full (FALSE, segment->rate,
 -        segment->applied_rate, segment->format,
 -        segment->start, segment->stop, segment->time);
++    event = gst_event_new_segment (segment);
+     gst_pad_send_event (pad, event);
+   }
  
    gst_object_unref (pad);
  }
Simple merge
@@@ -1,71 -1,42 +1,76 @@@
  EXPORTS
 +      gst_buffer_add_video_meta
 +      gst_buffer_add_video_meta_full
 +      gst_buffer_get_video_meta_id
 +      gst_buffer_pool_config_get_video_alignment
 +      gst_buffer_pool_config_set_video_alignment
 +      gst_color_balance_channel_get_type
 +      gst_color_balance_get_balance_type
 +      gst_color_balance_get_type
 +      gst_color_balance_get_value
 +      gst_color_balance_list_channels
 +      gst_color_balance_set_value
 +      gst_color_balance_type_get_type
 +      gst_color_balance_value_changed
 +      gst_is_video_overlay_prepare_window_handle_message
 +      gst_video_buffer_flags_get_type
        gst_video_calculate_display_ratio
 +      gst_video_chroma_site_get_type
 +      gst_video_color_matrix_get_type
 +      gst_video_color_primaries_get_type
 +      gst_video_color_range_get_type
 +      gst_video_colorimetry_from_string
 +      gst_video_colorimetry_matches
        gst_video_convert_frame
        gst_video_convert_frame_async
 +      gst_video_crop_meta_get_info
+       gst_video_event_is_force_key_unit
+       gst_video_event_new_downstream_force_key_unit
        gst_video_event_new_still_frame
+       gst_video_event_new_upstream_force_key_unit
+       gst_video_event_parse_downstream_force_key_unit
        gst_video_event_parse_still_frame
+       gst_video_event_parse_upstream_force_key_unit
        gst_video_filter_get_type
 -      gst_video_format_convert
 +      gst_video_flags_get_type
 +      gst_video_format_flags_get_type
        gst_video_format_from_fourcc
 -      gst_video_format_get_component_depth
 -      gst_video_format_get_component_height
 -      gst_video_format_get_component_offset
 -      gst_video_format_get_component_width
 -      gst_video_format_get_pixel_stride
 -      gst_video_format_get_row_stride
 -      gst_video_format_get_size
 +      gst_video_format_from_masks
 +      gst_video_format_from_string
 +      gst_video_format_get_info
        gst_video_format_get_type
 -      gst_video_format_has_alpha
 -      gst_video_format_is_gray
 -      gst_video_format_is_rgb
 -      gst_video_format_is_yuv
 -      gst_video_format_new_caps
 -      gst_video_format_new_caps_interlaced
 -      gst_video_format_new_template_caps
 -      gst_video_format_parse_caps
 -      gst_video_format_parse_caps_interlaced
        gst_video_format_to_fourcc
 -      gst_video_frame_rate
 -      gst_video_get_size
 -      gst_video_get_size_from_caps
 -      gst_video_parse_caps_chroma_site
 -      gst_video_parse_caps_color_matrix
 -      gst_video_parse_caps_framerate
 +      gst_video_format_to_string
 +      gst_video_frame_copy
 +      gst_video_frame_map
 +      gst_video_frame_map_id
 +      gst_video_frame_unmap
 +      gst_video_info_convert
 +      gst_video_info_from_caps
 +      gst_video_info_init
 +      gst_video_info_set_format
 +      gst_video_info_to_caps
 +      gst_video_marshal_VOID__OBJECT_INT
 +      gst_video_meta_get_info
 +      gst_video_meta_map
 +      gst_video_meta_unmap
 +      gst_video_orientation_get_hcenter
 +      gst_video_orientation_get_hflip
 +      gst_video_orientation_get_type
 +      gst_video_orientation_get_vcenter
 +      gst_video_orientation_get_vflip
 +      gst_video_orientation_set_hcenter
 +      gst_video_orientation_set_hflip
 +      gst_video_orientation_set_vcenter
 +      gst_video_orientation_set_vflip
 +      gst_video_overlay_expose
 +      gst_video_overlay_get_type
 +      gst_video_overlay_got_window_handle
 +      gst_video_overlay_handle_events
 +      gst_video_overlay_prepare_window_handle
 +      gst_video_overlay_set_render_rectangle
 +      gst_video_overlay_set_window_handle
        gst_video_parse_caps_palette
 -      gst_video_parse_caps_pixel_aspect_ratio
        gst_video_sink_center_rect
        gst_video_sink_get_type
 +      gst_video_transfer_function_get_type