#include "gstavutils.h"
#include "gstavprotocol.h"
-#ifdef GST_TIZEN_MODIFICATION
+#ifdef TIZEN_FEATURE_LIBAV
#include "libavformat/movenc.h"
-#endif /* GST_TIZEN_MODIFICATION */
+#endif /* TIZEN_FEATURE_LIBAV */
typedef struct _GstFFMpegMux GstFFMpegMux;
typedef struct _GstFFMpegMuxPad GstFFMpegMuxPad;
gboolean opened;
guint videopads, audiopads;
-#ifdef GST_TIZEN_MODIFICATION
+#ifdef TIZEN_FEATURE_LIBAV
guint expected_trailer_size;
guint nb_video_frames;
guint nb_audio_frames;
-#endif /* GST_TIZEN_MODIFICATION */
+#endif /* TIZEN_FEATURE_LIBAV */
/*< private > */
/* event_function is the collectpads default eventfunction */
PROP_0,
PROP_PRELOAD,
PROP_MAXDELAY
-#ifdef GST_TIZEN_MODIFICATION
+#ifdef TIZEN_FEATURE_LIBAV
, PROP_EXPECTED_TRAILER_SIZE,
PROP_NUMBER_VIDEO_FRAMES,
PROP_NUMBER_AUDIO_FRAMES
-#endif /* GST_TIZEN_MODIFICATION */
+#endif /* TIZEN_FEATURE_LIBAV */
};
/* A number of function prototypes are given so we can refer to them later. */
#define GST_FFMUX_PARAMS_QDATA g_quark_from_static_string("avmux-params")
-#ifdef GST_TIZEN_MODIFICATION
+#ifdef TIZEN_FEATURE_LIBAV
static void gst_ffmpegmux_release_pad(GstElement *element, GstPad *pad);
-#endif /* GST_TIZEN_MODIFICATION */
+#endif /* TIZEN_FEATURE_LIBAV */
static GstElementClass *parent_class = NULL;
}
-#ifdef GST_TIZEN_MODIFICATION
+#ifdef TIZEN_FEATURE_LIBAV
/* trailer entry size */
#define ENTRY_SIZE_VIDEO_STTS 8
#define ENTRY_SIZE_VIDEO_STSS 4
return;
}
-#endif /* GST_TIZEN_MODIFICATION */
+#endif /* TIZEN_FEATURE_LIBAV */
static void
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
-#ifdef GST_TIZEN_MODIFICATION
+#ifdef TIZEN_FEATURE_LIBAV
GParamSpec * tspec = NULL;
-#endif /* GST_TIZEN_MODIFICATION */
+#endif /* TIZEN_FEATURE_LIBAV */
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gstelement_class->change_state = gst_ffmpegmux_change_state;
gobject_class->finalize = gst_ffmpegmux_finalize;
-#ifdef GST_TIZEN_MODIFICATION
+#ifdef TIZEN_FEATURE_LIBAV
gstelement_class->release_pad = gst_ffmpegmux_release_pad;
/* properties */
g_object_class_install_property (gobject_class, PROP_NUMBER_AUDIO_FRAMES, tspec);
else
GST_ERROR("g_param_spec failed for \"number-audio-frames\"");
-#endif /* GST_TIZEN_MODIFICATION */
+#endif /* TIZEN_FEATURE_LIBAV */
}
static void
ffmpegmux->audiopads = 0;
ffmpegmux->max_delay = 0;
-#ifdef GST_TIZEN_MODIFICATION
+#ifdef TIZEN_FEATURE_LIBAV
ffmpegmux->expected_trailer_size = 0;
ffmpegmux->nb_video_frames = 0;
ffmpegmux->nb_audio_frames = 0;
-#endif /* GST_TIZEN_MODIFICATION */
+#endif /* TIZEN_FEATURE_LIBAV */
}
-#ifdef GST_TIZEN_MODIFICATION
+#ifdef TIZEN_FEATURE_LIBAV
static void
gst_ffmpegmux_release_pad (GstElement * element, GstPad * pad)
{
return;
}
-#endif /* GST_TIZEN_MODIFICATION */
+#endif /* TIZEN_FEATURE_LIBAV */
static void
gst_ffmpegmux_set_property (GObject * object, guint prop_id,
case PROP_MAXDELAY:
g_value_set_int (value, src->max_delay);
break;
-#ifdef GST_TIZEN_MODIFICATION
+#ifdef TIZEN_FEATURE_LIBAV
case PROP_EXPECTED_TRAILER_SIZE:
g_value_set_uint(value, src->expected_trailer_size);
break;
case PROP_NUMBER_AUDIO_FRAMES:
g_value_set_uint(value, src->nb_audio_frames);
break;
-#endif /* GST_TIZEN_MODIFICATION */
+#endif /* TIZEN_FEATURE_LIBAV */
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
* codec aspect. */
st->sample_aspect_ratio = st->codec->sample_aspect_ratio;
-#ifdef GST_TIZEN_MODIFICATION
+#ifdef TIZEN_FEATURE_LIBAV
/* ref counting bug fix */
gst_object_unref(ffmpegmux);
-#endif /* GST_TIZEN_MODIFICATION */
+#endif /* TIZEN_FEATURE_LIBAV */
GST_LOG_OBJECT (pad, "accepted caps %" GST_PTR_FORMAT, caps);
return TRUE;
/* ERRORS */
not_accepted:
{
-#ifdef GST_TIZEN_MODIFICATION
+#ifdef TIZEN_FEATURE_LIBAV
/* ref counting bug fix */
gst_object_unref (ffmpegmux);
-#endif /* GST_TIZEN_MODIFICATION */
+#endif /* TIZEN_FEATURE_LIBAV */
GST_LOG_OBJECT (pad, "rejecting caps %" GST_PTR_FORMAT, caps);
return FALSE;
}
gboolean need_free = FALSE;
GstMapInfo map;
-#ifdef GST_TIZEN_MODIFICATION
+#ifdef TIZEN_FEATURE_LIBAV
av_init_packet (&pkt);
pkt.is_mux = 1;
-#endif /* GST_TIZEN_MODIFICATION */
+#endif /* TIZEN_FEATURE_LIBAV */
/* push out current buffer */
buf =
ffmpegmux->context->streams[best_pad->padnum]->codec->frame_number++;
/* set time */
-#ifdef GST_TIZEN_MODIFICATION
+#ifdef TIZEN_FEATURE_LIBAV
if (ffmpegmux->context->streams[best_pad->padnum]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
pkt.pts = GST_TIME_AS_MSECONDS(GST_BUFFER_TIMESTAMP(buf));
else
-#else /* GST_TIZEN_MODIFICATION */
+#else /* TIZEN_FEATURE_LIBAV */
pkt.pts = gst_ffmpeg_time_gst_to_ff (GST_BUFFER_TIMESTAMP (buf),
ffmpegmux->context->streams[best_pad->padnum]->time_base);
-#endif /* GST_TIZEN_MODIFICATION */
+#endif /* TIZEN_FEATURE_LIBAV */
pkt.dts = pkt.pts;
if (strcmp (ffmpegmux->context->oformat->name, "gif") == 0) {
if (!GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT))
pkt.flags |= AV_PKT_FLAG_KEY;
-#ifdef GST_TIZEN_MODIFICATION
+#ifdef TIZEN_FEATURE_LIBAV
if (ffmpegmux->context->streams[best_pad->padnum]->codec->codec_type ==
AVMEDIA_TYPE_VIDEO) {
static int last_duration = -1;
}
update_expected_trailer_size (ffmpegmux);
-#else /* GST_TIZEN_MODIFICATION */
+#else /* TIZEN_FEATURE_LIBAV */
if (GST_BUFFER_DURATION_IS_VALID (buf))
pkt.duration =
gst_ffmpeg_time_gst_to_ff (GST_BUFFER_DURATION (buf),
ffmpegmux->context->streams[best_pad->padnum]->time_base);
else
pkt.duration = 0;
-#endif /* GST_TIZEN_MODIFICATION */
+#endif /* TIZEN_FEATURE_LIBAV */
av_write_frame (ffmpegmux->context, &pkt);
if (need_free) {
g_free (pkt.data);
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
-#ifdef GST_TIZEN_MODIFICATION
+#ifdef TIZEN_FEATURE_LIBAV
{
int i = 0;
-#endif /* GST_TIZEN_MODIFICATION */
+#endif /* TIZEN_FEATURE_LIBAV */
gst_tag_setter_reset_tags (GST_TAG_SETTER (ffmpegmux));
if (ffmpegmux->opened) {
ffmpegmux->opened = FALSE;
gst_ffmpegdata_close (ffmpegmux->context->pb);
}
-#ifdef GST_TIZEN_MODIFICATION
+#ifdef TIZEN_FEATURE_LIBAV
for (i = 0 ; i < ffmpegmux->context->nb_streams ; i++) {
ffmpegmux->context->streams[i]->start_time = AV_NOPTS_VALUE;
ffmpegmux->context->streams[i]->duration = AV_NOPTS_VALUE;