mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +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_set_cache (GstElement *element, GstCache *cache);
|
||||
static GstCache* gst_mpeg_demux_get_cache (GstElement *element);
|
||||
static void gst_mpeg_demux_set_index (GstElement *element, GstIndex *index);
|
||||
static GstIndex* gst_mpeg_demux_get_index (GstElement *element);
|
||||
|
||||
static GstElementStateReturn
|
||||
gst_mpeg_demux_change_state (GstElement *element);
|
||||
|
@ -182,8 +182,8 @@ gst_mpeg_demux_class_init (GstMPEGDemuxClass *klass)
|
|||
gstelement_class = (GstElementClass *) klass;
|
||||
|
||||
gstelement_class->change_state = gst_mpeg_demux_change_state;
|
||||
gstelement_class->set_cache = gst_mpeg_demux_set_cache;
|
||||
gstelement_class->get_cache = gst_mpeg_demux_get_cache;
|
||||
gstelement_class->set_index = gst_mpeg_demux_set_index;
|
||||
gstelement_class->get_index = gst_mpeg_demux_get_index;
|
||||
|
||||
mpeg_parse_class->parse_packhead = gst_mpeg_demux_parse_packhead;
|
||||
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));
|
||||
|
||||
if (mpeg_demux->cache) {
|
||||
gst_cache_get_writer_id (mpeg_demux->cache, GST_OBJECT (*outpad),
|
||||
&(*outstream)->cache_id);
|
||||
if (mpeg_demux->index) {
|
||||
gst_index_get_writer_id (mpeg_demux->index, GST_OBJECT (*outpad),
|
||||
&(*outstream)->index_id);
|
||||
}
|
||||
|
||||
if (GST_PAD_IS_USABLE (*outpad)) {
|
||||
|
@ -629,9 +629,9 @@ done:
|
|||
pts += mpeg_parse->adjust;
|
||||
timestamp = MPEGTIME_TO_GSTTIME (pts);
|
||||
|
||||
if (mpeg_demux->cache) {
|
||||
gst_cache_add_association (mpeg_demux->cache,
|
||||
(*outstream)->cache_id, 0,
|
||||
if (mpeg_demux->index) {
|
||||
gst_index_add_association (mpeg_demux->index,
|
||||
(*outstream)->index_id, 0,
|
||||
GST_FORMAT_BYTES, GST_BUFFER_OFFSET (buffer),
|
||||
GST_FORMAT_TIME, timestamp,
|
||||
0);
|
||||
|
@ -861,9 +861,9 @@ gst_mpeg_demux_parse_pes (GstMPEGParse *mpeg_parse, GstBuffer *buffer)
|
|||
|
||||
gst_element_add_pad(GST_ELEMENT(mpeg_demux), *outpad);
|
||||
|
||||
if (mpeg_demux->cache) {
|
||||
gst_cache_get_writer_id (mpeg_demux->cache, GST_OBJECT (*outpad),
|
||||
&(*outstream)->cache_id);
|
||||
if (mpeg_demux->index) {
|
||||
gst_index_get_writer_id (mpeg_demux->index, GST_OBJECT (*outpad),
|
||||
&(*outstream)->index_id);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -883,9 +883,9 @@ gst_mpeg_demux_parse_pes (GstMPEGParse *mpeg_parse, GstBuffer *buffer)
|
|||
pts += mpeg_parse->adjust;
|
||||
timestamp = MPEGTIME_TO_GSTTIME (pts);
|
||||
|
||||
if (mpeg_demux->cache) {
|
||||
gst_cache_add_association (mpeg_demux->cache,
|
||||
(*outstream)->cache_id, 0,
|
||||
if (mpeg_demux->index) {
|
||||
gst_index_add_association (mpeg_demux->index,
|
||||
(*outstream)->index_id, 0,
|
||||
GST_FORMAT_BYTES, GST_BUFFER_OFFSET (buffer),
|
||||
GST_FORMAT_TIME, timestamp,
|
||||
0);
|
||||
|
@ -931,25 +931,25 @@ gst_mpeg_demux_change_state (GstElement *element)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_mpeg_demux_set_cache (GstElement *element, GstCache *cache)
|
||||
gst_mpeg_demux_set_index (GstElement *element, GstIndex *index)
|
||||
{
|
||||
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->cache = cache;
|
||||
mpeg_demux->index = index;
|
||||
}
|
||||
|
||||
static GstCache*
|
||||
gst_mpeg_demux_get_cache (GstElement *element)
|
||||
static GstIndex*
|
||||
gst_mpeg_demux_get_index (GstElement *element)
|
||||
{
|
||||
GstMPEGDemux *mpeg_demux;
|
||||
|
||||
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;
|
||||
GstPad *pad;
|
||||
guint64 pts;
|
||||
gint cache_id;
|
||||
gint index_id;
|
||||
};
|
||||
|
||||
struct _GstMPEGDemux {
|
||||
|
@ -85,7 +85,7 @@ struct _GstMPEGDemux {
|
|||
GstMPEGStream *video_stream[NUM_VIDEO_STREAMS];
|
||||
GstMPEGStream *audio_stream[NUM_AUDIO_STREAMS];
|
||||
|
||||
GstCache *cache;
|
||||
GstIndex *index;
|
||||
};
|
||||
|
||||
struct _GstMPEGDemuxClass {
|
||||
|
|
|
@ -99,8 +99,8 @@ static void gst_mpeg_parse_get_property (GObject *object, guint prop_id,
|
|||
GValue *value, GParamSpec *pspec);
|
||||
static void gst_mpeg_parse_set_property (GObject *object, guint prop_id,
|
||||
const GValue *value, GParamSpec *pspec);
|
||||
static void gst_mpeg_parse_set_cache (GstElement *element, GstCache *tc);
|
||||
static GstCache* gst_mpeg_parse_get_cache (GstElement *element);
|
||||
static void gst_mpeg_parse_set_index (GstElement *element, GstIndex *index);
|
||||
static GstIndex* gst_mpeg_parse_get_index (GstElement *element);
|
||||
|
||||
static GstElementClass *parent_class = NULL;
|
||||
/*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->get_clock = gst_mpeg_parse_get_clock;
|
||||
gstelement_class->set_clock = gst_mpeg_parse_set_clock;
|
||||
gstelement_class->get_cache = gst_mpeg_parse_get_cache;
|
||||
gstelement_class->set_cache = gst_mpeg_parse_set_cache;
|
||||
gstelement_class->get_index = gst_mpeg_parse_get_index;
|
||||
gstelement_class->set_index = gst_mpeg_parse_set_index;
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if (mpeg_parse->cache) {
|
||||
/* update cache if any */
|
||||
gst_cache_add_association (mpeg_parse->cache, mpeg_parse->cache_id,
|
||||
if (mpeg_parse->index) {
|
||||
/* update index if any */
|
||||
gst_index_add_association (mpeg_parse->index, mpeg_parse->index_id,
|
||||
GST_ACCOCIATION_FLAG_KEY_UNIT,
|
||||
GST_FORMAT_BYTES, GST_BUFFER_OFFSET (buffer),
|
||||
GST_FORMAT_TIME, MPEGTIME_TO_GSTTIME (scr),
|
||||
|
@ -716,27 +716,27 @@ gst_mpeg_parse_set_property (GObject *object, guint prop_id,
|
|||
}
|
||||
|
||||
static void
|
||||
gst_mpeg_parse_set_cache (GstElement *element, GstCache *cache)
|
||||
gst_mpeg_parse_set_index (GstElement *element, GstIndex *index)
|
||||
{
|
||||
GstMPEGParse *mpeg_parse;
|
||||
|
||||
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),
|
||||
&mpeg_parse->cache_id);
|
||||
gst_cache_add_format (cache, mpeg_parse->cache_id, scr_format);
|
||||
gst_index_get_writer_id (index, GST_OBJECT (mpeg_parse->sinkpad),
|
||||
&mpeg_parse->index_id);
|
||||
gst_index_add_format (index, mpeg_parse->index_id, scr_format);
|
||||
}
|
||||
|
||||
static GstCache*
|
||||
gst_mpeg_parse_get_cache (GstElement *element)
|
||||
static GstIndex*
|
||||
gst_mpeg_parse_get_index (GstElement *element)
|
||||
{
|
||||
GstMPEGParse *mpeg_parse;
|
||||
|
||||
mpeg_parse = GST_MPEG_PARSE (element);
|
||||
|
||||
return mpeg_parse->cache;
|
||||
return mpeg_parse->index;
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
|
|
@ -71,8 +71,8 @@ struct _GstMPEGParse {
|
|||
GstClock *clock;
|
||||
gboolean sync;
|
||||
|
||||
GstCache *cache;
|
||||
gint cache_id;
|
||||
GstIndex *index;
|
||||
gint index_id;
|
||||
};
|
||||
|
||||
struct _GstMPEGParseClass {
|
||||
|
|
Loading…
Reference in a new issue