2 * Copyright (C) <2009> Edward Hervey <bilboed@bilboed.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __GST_FFMPEG_UTILS_H__
21 #define __GST_FFMPEG_UTILS_H__
23 #ifdef HAVE_FFMPEG_UNINSTALLED
26 #include <libavcodec/avcodec.h>
31 *Get the size of an picture
34 gst_ffmpeg_avpicture_get_size (int pix_fmt, int width, int height);
37 * Fill in pointers in an AVPicture, aligned by 4 (required by X).
41 gst_ffmpeg_avpicture_fill (AVPicture * picture,
43 enum PixelFormat pix_fmt,
48 * Convert from/to a GStreamer <-> FFMpeg timestamp.
51 gst_ffmpeg_time_ff_to_gst (gint64 pts, AVRational base)
55 if (pts == AV_NOPTS_VALUE){
56 out = GST_CLOCK_TIME_NONE;
58 AVRational bq = { 1, GST_SECOND };
59 out = av_rescale_q (pts, base, bq);
66 gst_ffmpeg_time_gst_to_ff (guint64 time, AVRational base)
70 if (!GST_CLOCK_TIME_IS_VALID (time) || base.num == 0) {
73 AVRational bq = { 1, GST_SECOND };
74 out = av_rescale_q (time, bq, base);
81 gst_ffmpeg_init_pix_fmt_info(void);
84 G_CONST_RETURN gchar *
85 gst_ffmpeg_get_codecid_longname (enum CodecID codec_id);
88 av_smp_format_depth(enum SampleFormat smp_fmt);
91 new_aligned_buffer (gint size, GstCaps * caps);
93 #endif /* __GST_FFMPEG_UTILS_H__ */