mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
cache->index
Original commit message from CVS: cache->index
This commit is contained in:
parent
d96e951b4d
commit
90936c1ebc
4 changed files with 41 additions and 41 deletions
|
@ -139,8 +139,8 @@ static void gst_mpeg_demux_send_data (GstMPEGParse *mpeg_parse,
|
||||||
|
|
||||||
static void gst_mpeg_demux_handle_discont (GstMPEGParse *mpeg_parse);
|
static void gst_mpeg_demux_handle_discont (GstMPEGParse *mpeg_parse);
|
||||||
|
|
||||||
static void gst_mpeg_demux_set_cache (GstElement *element, GstCache *cache);
|
static void gst_mpeg_demux_set_index (GstElement *element, GstIndex *index);
|
||||||
static GstCache* gst_mpeg_demux_get_cache (GstElement *element);
|
static GstIndex* gst_mpeg_demux_get_index (GstElement *element);
|
||||||
|
|
||||||
static GstElementStateReturn
|
static GstElementStateReturn
|
||||||
gst_mpeg_demux_change_state (GstElement *element);
|
gst_mpeg_demux_change_state (GstElement *element);
|
||||||
|
@ -182,8 +182,8 @@ gst_mpeg_demux_class_init (GstMPEGDemuxClass *klass)
|
||||||
gstelement_class = (GstElementClass *) klass;
|
gstelement_class = (GstElementClass *) klass;
|
||||||
|
|
||||||
gstelement_class->change_state = gst_mpeg_demux_change_state;
|
gstelement_class->change_state = gst_mpeg_demux_change_state;
|
||||||
gstelement_class->set_cache = gst_mpeg_demux_set_cache;
|
gstelement_class->set_index = gst_mpeg_demux_set_index;
|
||||||
gstelement_class->get_cache = gst_mpeg_demux_get_cache;
|
gstelement_class->get_index = gst_mpeg_demux_get_index;
|
||||||
|
|
||||||
mpeg_parse_class->parse_packhead = gst_mpeg_demux_parse_packhead;
|
mpeg_parse_class->parse_packhead = gst_mpeg_demux_parse_packhead;
|
||||||
mpeg_parse_class->parse_syshead = gst_mpeg_demux_parse_syshead;
|
mpeg_parse_class->parse_syshead = gst_mpeg_demux_parse_syshead;
|
||||||
|
@ -428,9 +428,9 @@ gst_mpeg_demux_parse_syshead (GstMPEGParse *mpeg_parse, GstBuffer *buffer)
|
||||||
|
|
||||||
gst_element_add_pad (GST_ELEMENT (mpeg_demux), (*outpad));
|
gst_element_add_pad (GST_ELEMENT (mpeg_demux), (*outpad));
|
||||||
|
|
||||||
if (mpeg_demux->cache) {
|
if (mpeg_demux->index) {
|
||||||
gst_cache_get_writer_id (mpeg_demux->cache, GST_OBJECT (*outpad),
|
gst_index_get_writer_id (mpeg_demux->index, GST_OBJECT (*outpad),
|
||||||
&(*outstream)->cache_id);
|
&(*outstream)->index_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GST_PAD_IS_USABLE (*outpad)) {
|
if (GST_PAD_IS_USABLE (*outpad)) {
|
||||||
|
@ -629,9 +629,9 @@ done:
|
||||||
pts += mpeg_parse->adjust;
|
pts += mpeg_parse->adjust;
|
||||||
timestamp = MPEGTIME_TO_GSTTIME (pts);
|
timestamp = MPEGTIME_TO_GSTTIME (pts);
|
||||||
|
|
||||||
if (mpeg_demux->cache) {
|
if (mpeg_demux->index) {
|
||||||
gst_cache_add_association (mpeg_demux->cache,
|
gst_index_add_association (mpeg_demux->index,
|
||||||
(*outstream)->cache_id, 0,
|
(*outstream)->index_id, 0,
|
||||||
GST_FORMAT_BYTES, GST_BUFFER_OFFSET (buffer),
|
GST_FORMAT_BYTES, GST_BUFFER_OFFSET (buffer),
|
||||||
GST_FORMAT_TIME, timestamp,
|
GST_FORMAT_TIME, timestamp,
|
||||||
0);
|
0);
|
||||||
|
@ -861,9 +861,9 @@ gst_mpeg_demux_parse_pes (GstMPEGParse *mpeg_parse, GstBuffer *buffer)
|
||||||
|
|
||||||
gst_element_add_pad(GST_ELEMENT(mpeg_demux), *outpad);
|
gst_element_add_pad(GST_ELEMENT(mpeg_demux), *outpad);
|
||||||
|
|
||||||
if (mpeg_demux->cache) {
|
if (mpeg_demux->index) {
|
||||||
gst_cache_get_writer_id (mpeg_demux->cache, GST_OBJECT (*outpad),
|
gst_index_get_writer_id (mpeg_demux->index, GST_OBJECT (*outpad),
|
||||||
&(*outstream)->cache_id);
|
&(*outstream)->index_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -883,9 +883,9 @@ gst_mpeg_demux_parse_pes (GstMPEGParse *mpeg_parse, GstBuffer *buffer)
|
||||||
pts += mpeg_parse->adjust;
|
pts += mpeg_parse->adjust;
|
||||||
timestamp = MPEGTIME_TO_GSTTIME (pts);
|
timestamp = MPEGTIME_TO_GSTTIME (pts);
|
||||||
|
|
||||||
if (mpeg_demux->cache) {
|
if (mpeg_demux->index) {
|
||||||
gst_cache_add_association (mpeg_demux->cache,
|
gst_index_add_association (mpeg_demux->index,
|
||||||
(*outstream)->cache_id, 0,
|
(*outstream)->index_id, 0,
|
||||||
GST_FORMAT_BYTES, GST_BUFFER_OFFSET (buffer),
|
GST_FORMAT_BYTES, GST_BUFFER_OFFSET (buffer),
|
||||||
GST_FORMAT_TIME, timestamp,
|
GST_FORMAT_TIME, timestamp,
|
||||||
0);
|
0);
|
||||||
|
@ -931,25 +931,25 @@ gst_mpeg_demux_change_state (GstElement *element)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_mpeg_demux_set_cache (GstElement *element, GstCache *cache)
|
gst_mpeg_demux_set_index (GstElement *element, GstIndex *index)
|
||||||
{
|
{
|
||||||
GstMPEGDemux *mpeg_demux;
|
GstMPEGDemux *mpeg_demux;
|
||||||
|
|
||||||
GST_ELEMENT_CLASS (parent_class)->set_cache (element, cache);
|
GST_ELEMENT_CLASS (parent_class)->set_index (element, index);
|
||||||
|
|
||||||
mpeg_demux = GST_MPEG_DEMUX (element);
|
mpeg_demux = GST_MPEG_DEMUX (element);
|
||||||
|
|
||||||
mpeg_demux->cache = cache;
|
mpeg_demux->index = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCache*
|
static GstIndex*
|
||||||
gst_mpeg_demux_get_cache (GstElement *element)
|
gst_mpeg_demux_get_index (GstElement *element)
|
||||||
{
|
{
|
||||||
GstMPEGDemux *mpeg_demux;
|
GstMPEGDemux *mpeg_demux;
|
||||||
|
|
||||||
mpeg_demux = GST_MPEG_DEMUX (element);
|
mpeg_demux = GST_MPEG_DEMUX (element);
|
||||||
|
|
||||||
return mpeg_demux->cache;
|
return mpeg_demux->index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ struct _GstMPEGStream {
|
||||||
gint16 STD_buffer_size_bound;
|
gint16 STD_buffer_size_bound;
|
||||||
GstPad *pad;
|
GstPad *pad;
|
||||||
guint64 pts;
|
guint64 pts;
|
||||||
gint cache_id;
|
gint index_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstMPEGDemux {
|
struct _GstMPEGDemux {
|
||||||
|
@ -85,7 +85,7 @@ struct _GstMPEGDemux {
|
||||||
GstMPEGStream *video_stream[NUM_VIDEO_STREAMS];
|
GstMPEGStream *video_stream[NUM_VIDEO_STREAMS];
|
||||||
GstMPEGStream *audio_stream[NUM_AUDIO_STREAMS];
|
GstMPEGStream *audio_stream[NUM_AUDIO_STREAMS];
|
||||||
|
|
||||||
GstCache *cache;
|
GstIndex *index;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstMPEGDemuxClass {
|
struct _GstMPEGDemuxClass {
|
||||||
|
|
|
@ -99,8 +99,8 @@ static void gst_mpeg_parse_get_property (GObject *object, guint prop_id,
|
||||||
GValue *value, GParamSpec *pspec);
|
GValue *value, GParamSpec *pspec);
|
||||||
static void gst_mpeg_parse_set_property (GObject *object, guint prop_id,
|
static void gst_mpeg_parse_set_property (GObject *object, guint prop_id,
|
||||||
const GValue *value, GParamSpec *pspec);
|
const GValue *value, GParamSpec *pspec);
|
||||||
static void gst_mpeg_parse_set_cache (GstElement *element, GstCache *tc);
|
static void gst_mpeg_parse_set_index (GstElement *element, GstIndex *index);
|
||||||
static GstCache* gst_mpeg_parse_get_cache (GstElement *element);
|
static GstIndex* gst_mpeg_parse_get_index (GstElement *element);
|
||||||
|
|
||||||
static GstElementClass *parent_class = NULL;
|
static GstElementClass *parent_class = NULL;
|
||||||
/*static guint gst_mpeg_parse_signals[LAST_SIGNAL] = { 0 };*/
|
/*static guint gst_mpeg_parse_signals[LAST_SIGNAL] = { 0 };*/
|
||||||
|
@ -156,8 +156,8 @@ gst_mpeg_parse_class_init (GstMPEGParseClass *klass)
|
||||||
gstelement_class->change_state = gst_mpeg_parse_change_state;
|
gstelement_class->change_state = gst_mpeg_parse_change_state;
|
||||||
gstelement_class->get_clock = gst_mpeg_parse_get_clock;
|
gstelement_class->get_clock = gst_mpeg_parse_get_clock;
|
||||||
gstelement_class->set_clock = gst_mpeg_parse_set_clock;
|
gstelement_class->set_clock = gst_mpeg_parse_set_clock;
|
||||||
gstelement_class->get_cache = gst_mpeg_parse_get_cache;
|
gstelement_class->get_index = gst_mpeg_parse_get_index;
|
||||||
gstelement_class->set_cache = gst_mpeg_parse_set_cache;
|
gstelement_class->set_index = gst_mpeg_parse_set_index;
|
||||||
|
|
||||||
|
|
||||||
klass->parse_packhead = gst_mpeg_parse_parse_packhead;
|
klass->parse_packhead = gst_mpeg_parse_parse_packhead;
|
||||||
|
@ -351,9 +351,9 @@ gst_mpeg_parse_parse_packhead (GstMPEGParse *mpeg_parse, GstBuffer *buffer)
|
||||||
scr = scr_adj;
|
scr = scr_adj;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mpeg_parse->cache) {
|
if (mpeg_parse->index) {
|
||||||
/* update cache if any */
|
/* update index if any */
|
||||||
gst_cache_add_association (mpeg_parse->cache, mpeg_parse->cache_id,
|
gst_index_add_association (mpeg_parse->index, mpeg_parse->index_id,
|
||||||
GST_ACCOCIATION_FLAG_KEY_UNIT,
|
GST_ACCOCIATION_FLAG_KEY_UNIT,
|
||||||
GST_FORMAT_BYTES, GST_BUFFER_OFFSET (buffer),
|
GST_FORMAT_BYTES, GST_BUFFER_OFFSET (buffer),
|
||||||
GST_FORMAT_TIME, MPEGTIME_TO_GSTTIME (scr),
|
GST_FORMAT_TIME, MPEGTIME_TO_GSTTIME (scr),
|
||||||
|
@ -716,27 +716,27 @@ gst_mpeg_parse_set_property (GObject *object, guint prop_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_mpeg_parse_set_cache (GstElement *element, GstCache *cache)
|
gst_mpeg_parse_set_index (GstElement *element, GstIndex *index)
|
||||||
{
|
{
|
||||||
GstMPEGParse *mpeg_parse;
|
GstMPEGParse *mpeg_parse;
|
||||||
|
|
||||||
mpeg_parse = GST_MPEG_PARSE (element);
|
mpeg_parse = GST_MPEG_PARSE (element);
|
||||||
|
|
||||||
mpeg_parse->cache = cache;
|
mpeg_parse->index = index;
|
||||||
|
|
||||||
gst_cache_get_writer_id (cache, GST_OBJECT (mpeg_parse->sinkpad),
|
gst_index_get_writer_id (index, GST_OBJECT (mpeg_parse->sinkpad),
|
||||||
&mpeg_parse->cache_id);
|
&mpeg_parse->index_id);
|
||||||
gst_cache_add_format (cache, mpeg_parse->cache_id, scr_format);
|
gst_index_add_format (index, mpeg_parse->index_id, scr_format);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCache*
|
static GstIndex*
|
||||||
gst_mpeg_parse_get_cache (GstElement *element)
|
gst_mpeg_parse_get_index (GstElement *element)
|
||||||
{
|
{
|
||||||
GstMPEGParse *mpeg_parse;
|
GstMPEGParse *mpeg_parse;
|
||||||
|
|
||||||
mpeg_parse = GST_MPEG_PARSE (element);
|
mpeg_parse = GST_MPEG_PARSE (element);
|
||||||
|
|
||||||
return mpeg_parse->cache;
|
return mpeg_parse->index;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
|
|
@ -71,8 +71,8 @@ struct _GstMPEGParse {
|
||||||
GstClock *clock;
|
GstClock *clock;
|
||||||
gboolean sync;
|
gboolean sync;
|
||||||
|
|
||||||
GstCache *cache;
|
GstIndex *index;
|
||||||
gint cache_id;
|
gint index_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstMPEGParseClass {
|
struct _GstMPEGParseClass {
|
||||||
|
|
Loading…
Reference in a new issue