X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst%2Fgstcompat.h;h=1349ab4cd6df8dc6bfae05683c5da1b34de25f54;hb=b89b1802df44829a0c034db5807bc893ad3c7774;hp=cba5fc23f40ddf7ebae438a76373326e38cae622;hpb=e01b5c0f46ddb4324dabed730cb54742b254b2ea;p=platform%2Fupstream%2Fgstreamer.git diff --git a/gst/gstcompat.h b/gst/gstcompat.h index cba5fc2..1349ab4 100644 --- a/gst/gstcompat.h +++ b/gst/gstcompat.h @@ -16,11 +16,16 @@ * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ + +/* API compatibility stuff */ +#ifndef __GSTCOMPAT_H__ +#define __GSTCOMPAT_H__ /** * SECTION:gstcompat + * @title: GstCompat * @short_description: Deprecated API entries * * Please do not use these in new code. @@ -28,12 +33,39 @@ * This can be done in CFLAGS for compiling old code. */ -/* API compatibility stuff */ -#ifndef __GSTCOMPAT_H__ -#define __GSTCOMPAT_H__ +#include +#include + G_BEGIN_DECLS +#define gst_buffer_new_and_alloc(s) gst_buffer_new_allocate(NULL, s, NULL) + +#define GST_BUFFER_TIMESTAMP GST_BUFFER_PTS +#define GST_BUFFER_TIMESTAMP_IS_VALID GST_BUFFER_PTS_IS_VALID + +static inline gboolean +gst_pad_set_caps (GstPad * pad, GstCaps * caps) +{ + GstEvent *event; + gboolean res = TRUE; + + g_return_val_if_fail (GST_IS_PAD (pad), FALSE); + g_return_val_if_fail (caps != NULL && gst_caps_is_fixed (caps), FALSE); + + event = gst_event_new_caps (caps); + + if (GST_PAD_IS_SRC (pad)) + res = gst_pad_push_event (pad, event); + else + res = gst_pad_send_event (pad, event); + + return res; +} + + +#ifndef GST_DISABLE_DEPRECATED + /* added to ease the transition to 0.11 */ #define gst_element_class_set_details_simple gst_element_class_set_metadata @@ -47,12 +79,22 @@ G_BEGIN_DECLS #define gst_pad_get_caps_reffed(p) gst_pad_get_caps(p) #define gst_pad_peer_get_caps_reffed(p) gst_pad_peer_get_caps(p) -//#define gst_buffer_create_sub(b,o,s) gst_buffer_copy_region(b,GST_BUFFER_COPY_ALL,o,s) +#define gst_adapter_prev_timestamp gst_adapter_prev_pts -#define gst_buffer_new_and_alloc(s) gst_buffer_new_allocate(NULL, s, 0) +#define gst_tag_list_free(taglist) gst_tag_list_unref(taglist) - -#ifndef GST_DISABLE_DEPRECATED +#define GST_MESSAGE_DURATION GST_MESSAGE_DURATION_CHANGED +#define gst_message_new_duration(src,fmt,dur) \ + gst_message_new_duration_changed(src) +#define gst_message_parse_duration(msg,fmt,dur) \ +G_STMT_START { \ + GstFormat *p_fmt = fmt; \ + gint64 *p_dur = dur; \ + if (p_fmt) \ + *p_fmt = GST_FORMAT_TIME; \ + if (p_dur) \ + *p_dur = GST_CLOCK_TIME_NONE; \ +} G_STMT_END #endif /* not GST_DISABLE_DEPRECATED */