Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gst-plugins-base
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Seungha Yang
gst-plugins-base
Commits
68eca5a9
Commit
68eca5a9
authored
Nov 30, 2005
by
Thomas Vander Stichele
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reorganize stuff under tests/
Original commit message from CVS: reorganize stuff under tests/
parent
d8ceb021
Changes
28
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
64 additions
and
3473 deletions
+64
-3473
ChangeLog
ChangeLog
+31
-0
Makefile.am
Makefile.am
+0
-8
configure.ac
configure.ac
+2
-2
examples/Makefile.am
examples/Makefile.am
+0
-15
examples/capsfilter/Makefile.am
examples/capsfilter/Makefile.am
+0
-6
examples/capsfilter/capsfilter1.c
examples/capsfilter/capsfilter1.c
+0
-87
examples/gob/Makefile.am
examples/gob/Makefile.am
+0
-19
examples/gob/gst-identity2.gob
examples/gob/gst-identity2.gob
+0
-141
examples/indexing/.gitignore
examples/indexing/.gitignore
+0
-1
examples/indexing/Makefile.am
examples/indexing/Makefile.am
+0
-7
examples/indexing/indexmpeg.c
examples/indexing/indexmpeg.c
+0
-321
examples/seeking/.gitignore
examples/seeking/.gitignore
+0
-6
examples/seeking/Makefile.am
examples/seeking/Makefile.am
+0
-7
examples/seeking/cdparanoia.c
examples/seeking/cdparanoia.c
+0
-215
examples/seeking/cdplayer.c
examples/seeking/cdplayer.c
+0
-292
examples/seeking/chained.c
examples/seeking/chained.c
+0
-107
examples/seeking/scrubby.c
examples/seeking/scrubby.c
+0
-558
examples/seeking/seek.c
examples/seeking/seek.c
+0
-1458
examples/stats/Makefile.am
examples/stats/Makefile.am
+0
-6
examples/stats/mp2ogg.c
examples/stats/mp2ogg.c
+0
-102
examples/switch/.gitignore
examples/switch/.gitignore
+0
-1
examples/switch/Makefile.am
examples/switch/Makefile.am
+0
-7
examples/switch/switcher.c
examples/switch/switcher.c
+0
-104
tests/Makefile.am
tests/Makefile.am
+19
-0
tests/check/generic/.gitignore
tests/check/generic/.gitignore
+1
-0
tests/check/pipelines/.gitignore
tests/check/pipelines/.gitignore
+1
-1
tests/examples/Makefile.am
tests/examples/Makefile.am
+9
-0
tests/examples/seek/Makefile.am
tests/examples/seek/Makefile.am
+1
-2
No files found.
ChangeLog
View file @
68eca5a9
2005-11-30 Thomas Vander Stichele <thomas (at) apestaart (dot) org>
* Makefile.am:
* configure.ac:
* examples/Makefile.am:
* examples/capsfilter/Makefile.am:
* examples/capsfilter/capsfilter1.c:
* examples/gob/Makefile.am:
* examples/gob/gst-identity2.gob:
* examples/indexing/.cvsignore:
* examples/indexing/Makefile.am:
* examples/indexing/indexmpeg.c:
* examples/seeking/.cvsignore:
* examples/seeking/Makefile.am:
* examples/seeking/cdparanoia.c:
* examples/seeking/cdplayer.c:
* examples/seeking/chained.c:
* examples/seeking/scrubby.c:
* examples/seeking/seek.c:
* examples/stats/Makefile.am:
* examples/stats/mp2ogg.c:
* examples/switch/.cvsignore:
* examples/switch/Makefile.am:
* examples/switch/switcher.c:
* tests/Makefile.am:
* tests/check/generic/.cvsignore:
* tests/check/pipelines/.cvsignore:
* tests/examples/Makefile.am:
* tests/examples/seek/Makefile.am:
reorganize stuff under tests/
2005-11-30 Edward Hervey <edward@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind):
...
...
Makefile.am
View file @
68eca5a9
...
...
@@ -6,16 +6,9 @@ else
SUBDIRS_EXT
=
endif
if
BUILD_EXAMPLES
SUBDIRS_EXAMPLES
=
examples
else
SUBDIRS_EXAMPLES
=
endif
SUBDIRS
=
\
gst-libs
\
gst sys
$(SUBDIRS_EXT)
\
$(SUBDIRS_EXAMPLES)
\
tools
\
docs
\
po
\
...
...
@@ -27,7 +20,6 @@ DIST_SUBDIRS = \
docs
\
gst-libs
\
gst sys ext
\
examples
\
tools
\
po
\
common
\
...
...
configure.ac
View file @
68eca5a9
...
...
@@ -609,14 +609,14 @@ gst-libs/gst/riff/Makefile
gst-libs/gst/rtp/Makefile
gst-libs/gst/tag/Makefile
gst-libs/gst/video/Makefile
examples/seeking/Makefile
examples/Makefile
tools/Makefile
pkgconfig/Makefile
pkgconfig/gstreamer-plugins-base.pc
pkgconfig/gstreamer-plugins-base-uninstalled.pc
tests/Makefile
tests/check/Makefile
tests/examples/Makefile
tests/examples/seek/Makefile
docs/Makefile
docs/libs/Makefile
docs/plugins/Makefile
...
...
examples/Makefile.am
deleted
100644 → 0
View file @
d8ceb021
if
HAVE_FT2
FT2_SUBDIRS
=
seeking
else
FT2_SUBDIRS
=
endif
# if HAVE_GTK
# GTK_SUBDIRS=dynparams $(FT2_SUBDIRS)
# else
GTK_SUBDIRS
=
# endif
SUBDIRS
=
$(GTK_SUBDIRS)
#DIST_SUBDIRS=capsfilter seeking indexing switch
DIST_SUBDIRS
=
seeking
examples/capsfilter/Makefile.am
deleted
100644 → 0
View file @
d8ceb021
noinst_PROGRAMS
=
capsfilter1
LDADD
=
$(GST_LIBS)
AM_CFLAGS
=
$(GST_CFLAGS)
examples/capsfilter/capsfilter1.c
deleted
100644 → 0
View file @
d8ceb021
#include <string.h>
#include <gst/gst.h>
/* This app uses a filter to connect colorspace and videosink
* so that only RGB data can pass the connection, colorspace will use
* a converter to convert the I420 data to RGB. Without a filter, this
* connection would use the I420 format (assuming Xv is enabled) */
static
void
new_pad_func
(
GstElement
*
element
,
GstPad
*
newpad
,
gpointer
data
)
{
GstElement
*
pipeline
=
(
GstElement
*
)
data
;
GstElement
*
queue
=
gst_bin_get_by_name
(
GST_BIN
(
pipeline
),
"queue"
);
if
(
!
strcmp
(
gst_pad_get_name
(
newpad
),
"video_00"
))
{
gst_element_set_state
(
pipeline
,
GST_STATE_PAUSED
);
gst_pad_link
(
newpad
,
gst_element_get_pad
(
queue
,
"sink"
));
gst_element_set_state
(
pipeline
,
GST_STATE_PLAYING
);
}
}
gint
main
(
gint
argc
,
gchar
*
argv
[])
{
GstElement
*
pipeline
;
GstElement
*
filesrc
;
GstElement
*
demux
;
GstElement
*
thread
;
GstElement
*
queue
;
GstElement
*
mpeg2dec
;
GstElement
*
colorspace
;
GstElement
*
videosink
;
gboolean
res
;
gst_init
(
&
argc
,
&
argv
);
if
(
argc
<
2
)
{
g_print
(
"usage: %s <mpeg1 system stream>
\n
"
,
argv
[
0
]);
return
(
-
1
);
}
pipeline
=
gst_pipeline_new
(
"main_pipeline"
);
filesrc
=
gst_element_factory_make
(
"filesrc"
,
"filesrc"
);
g_return_val_if_fail
(
filesrc
,
-
1
);
g_object_set
(
G_OBJECT
(
filesrc
),
"location"
,
argv
[
1
],
NULL
);
demux
=
gst_element_factory_make
(
"mpegdemux"
,
"demux"
);
g_return_val_if_fail
(
demux
,
-
1
);
g_signal_connect
(
G_OBJECT
(
demux
),
"new_pad"
,
G_CALLBACK
(
new_pad_func
),
pipeline
);
thread
=
gst_thread_new
(
"thread"
);
queue
=
gst_element_factory_make
(
"queue"
,
"queue"
);
mpeg2dec
=
gst_element_factory_make
(
"mpeg2dec"
,
"mpeg2dec"
);
g_return_val_if_fail
(
mpeg2dec
,
-
1
);
colorspace
=
gst_element_factory_make
(
"ffmpegcolorspace"
,
"colorspace"
);
g_return_val_if_fail
(
colorspace
,
-
1
);
videosink
=
gst_element_factory_make
(
DEFAULT_VIDEOSINK
,
"videosink"
);
g_return_val_if_fail
(
videosink
,
-
1
);
gst_bin_add
(
GST_BIN
(
pipeline
),
filesrc
);
gst_bin_add
(
GST_BIN
(
pipeline
),
demux
);
gst_bin_add
(
GST_BIN
(
thread
),
queue
);
gst_bin_add
(
GST_BIN
(
thread
),
mpeg2dec
);
gst_bin_add
(
GST_BIN
(
thread
),
colorspace
);
gst_bin_add
(
GST_BIN
(
thread
),
videosink
);
gst_bin_add
(
GST_BIN
(
pipeline
),
thread
);
gst_element_link_pads
(
filesrc
,
"src"
,
demux
,
"sink"
);
gst_element_link_pads
(
queue
,
"src"
,
mpeg2dec
,
"sink"
);
gst_element_link_pads
(
mpeg2dec
,
"src"
,
colorspace
,
"sink"
);
/* force RGB data passing between colorspace and videosink */
res
=
gst_element_link_pads_filtered
(
colorspace
,
"src"
,
videosink
,
"sink"
,
gst_caps_new_simple
(
"video/x-raw-rgb"
,
NULL
));
if
(
!
res
)
{
g_print
(
"could not connect colorspace and videosink
\n
"
);
return
-
1
;
}
gst_element_set_state
(
pipeline
,
GST_STATE_PLAYING
);
while
(
gst_bin_iterate
(
GST_BIN
(
pipeline
)));
gst_element_set_state
(
pipeline
,
GST_STATE_NULL
);
return
0
;
}
examples/gob/Makefile.am
deleted
100644 → 0
View file @
d8ceb021
plugin_LTLIBRARIES
=
libgstidentity2.la
GOB_FILES_ID
=
gst-identity2.c gst-identity2.h gst-identity2-private.h
BUILT_SOURCES
=
\
$(GOB_FILES_ID)
libgstidentity2_la_SOURCES
=
gst-identity2.gob
$(GOB_FILES_ID)
libgstidentity2_la_CFLAGS
=
$(GST_CFLAGS)
libgstidentity2_la_LIBADD
=
%.c %.h %-private.h
:
%.gob
gob
$<
CLEANFILES
=
$(GOB_FILES_ID)
dist-hook
:
cd
$(distdir)
;
rm
-f
$(CLEANFILES)
examples/gob/gst-identity2.gob
deleted
100644 → 0
View file @
d8ceb021
%header{
#include <gst/gst.h>
#include "gst-identity2.h"
#include "gst-identity2-private.h"
%}
class Gst:Identity2 from Gst:Element {
/* plugin init */
private gboolean
plugin_init (GModule *module, GstPlugin *plugin)
{
static GstElementDetails identity2_details = {
"GOB Identity",
"Filter/Effect",
"Does nothing",
"1.0",
"Wim Taymans <wim.taymans@chello.be>",
"(C) 2001",
};
GstElementFactory *factory;
factory = gst_elementfactory_new ("identity2", TYPE_SELF,
&identity2_details);
g_return_val_if_fail (factory != NULL, FALSE);
gst_plugin_add_feature (plugin, &(factory->feature));
return TRUE;
}
/* pads FIXME gob oculd be improved here */
private GstPad *sinkpad =
{
gst_pad_new ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (o), o->_priv->sinkpad);
gst_pad_set_chain_function (o->_priv->sinkpad, chain);
gst_pad_set_bufferpool_function (o->_priv->sinkpad, get_bufferpool);
//gst_pad_set_negotiate_function (o->_priv->sinkpad, negotiate_sink);
};
private GstPad *srcpad =
{
gst_pad_new ("src", GST_PAD_SRC);
gst_element_add_pad (GST_ELEMENT (o), o->_priv->srcpad);
//gst_pad_set_negotiate_function (o->_priv->srcpad, negotiate_src);
};
/* arguments */
/*
private gboolean loop_based = FALSE; argument BOOL loop_based
get {
ARG = self->_priv->loop_based;
}
set {
self->_priv->loop_based = ARG;
if (self->_priv->loop_based) {
gst_element_set_loop_function (GST_ELEMENT (self), loop);
gst_pad_set_chain_function (self->_priv->sinkpad, NULL);
}
else {
gst_pad_set_chain_function (self->_priv->sinkpad, chain);
gst_element_set_loop_function (GST_ELEMENT (self), NULL);
}
};*/
private guint sleep_time = 0; argument UINT sleep_time link;
private gboolean silent = FALSE; argument BOOL silent link;
/* signals */
private signal last NONE(NONE) void handoff(self);
/* core code here */
private GstBufferPool*
get_bufferpool (GstPad *pad (check null))
{
Self *self = SELF (gst_pad_get_parent (pad));
return gst_pad_get_bufferpool (self->_priv->srcpad);
}
/* private GstPadNegotiateReturn
negotiate_src (GstPad *pad, GstCaps **caps, gpointer *data)
{
Self *self = SELF (gst_pad_get_parent (pad));
return gst_pad_negotiate_proxy (pad, self->_priv->sinkpad, caps);
}
private GstPadNegotiateReturn
negotiate_sink (GstPad *pad, GstCaps **caps, gpointer *data)
{
Self *self = SELF (gst_pad_get_parent (pad));
return gst_pad_negotiate_proxy (pad, self->_priv->srcpad, caps);
} */
private void
chain (GstPad *pad (check null), GstBuffer *buf (check null))
{
Self *self;
self = SELF (gst_pad_get_parent (pad));
if (!self->_priv->silent)
g_print("identity2: chain ******* (%s:%s)i \n",GST_DEBUG_PAD_NAME(pad));
handoff (self);
gst_pad_push (self->_priv->srcpad, buf);
if (self->_priv->sleep_time)
usleep (self->_priv->sleep_time);
}
/*private void
loop (GstElement *element (check null))
{
Self *self = SELF (element);
GstBuffer *buf;
do {
buf = gst_pad_pull (self->_priv->sinkpad);
g_print("identity2: loop ******* (%s:%s)i \n",GST_DEBUG_PAD_NAME(self->_priv->sinkpad));
handoff (self);
gst_pad_push (self->_priv->srcpad, buf);
if (self->_priv->sleep_time)
usleep (self->_priv->sleep_time);
} while (!GST_ELEMENT_IS_COTHREAD_STOPPING(element));
}*/
}
%{
GstPluginDesc plugin_desc = {
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"identity2",
gst_identity2_plugin_init
};
%}
examples/indexing/.gitignore
deleted
100644 → 0
View file @
d8ceb021
indexmpeg
examples/indexing/Makefile.am
deleted
100644 → 0
View file @
d8ceb021
examples
=
indexmpeg
noinst_PROGRAMS
=
$(examples)
# we have nothing but apps here, we can do this safely
LIBS
=
$(GST_LIBS)
$(GTK_LIBS)
AM_CFLAGS
=
$(GST_CFLAGS)
$(GTK_CFLAGS)
examples/indexing/indexmpeg.c
deleted
100644 → 0
View file @
d8ceb021
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* 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.
*/
#include <string.h>
#include <gst/gst.h>
static
gboolean
verbose
=
FALSE
;
static
gboolean
quiet
=
FALSE
;
static
void
entry_added
(
GstIndex
*
index
,
GstIndexEntry
*
entry
)
{
switch
(
entry
->
type
)
{
case
GST_INDEX_ENTRY_ID
:
g_print
(
"id %d describes writer %s
\n
"
,
entry
->
id
,
GST_INDEX_ID_DESCRIPTION
(
entry
));
break
;
case
GST_INDEX_ENTRY_FORMAT
:
g_print
(
"%d: registered format %d for %s
\n
"
,
entry
->
id
,
GST_INDEX_FORMAT_FORMAT
(
entry
),
GST_INDEX_FORMAT_KEY
(
entry
));
break
;
case
GST_INDEX_ENTRY_ASSOCIATION
:
{
gint
i
;
g_print
(
"%p, %d: %08x "
,
entry
,
entry
->
id
,
GST_INDEX_ASSOC_FLAGS
(
entry
));
for
(
i
=
0
;
i
<
GST_INDEX_NASSOCS
(
entry
);
i
++
)
{
g_print
(
"%d %"
G_GINT64_FORMAT
" "
,
GST_INDEX_ASSOC_FORMAT
(
entry
,
i
),
GST_INDEX_ASSOC_VALUE
(
entry
,
i
));
}
g_print
(
"
\n
"
);
break
;
}
default:
break
;
}
}
typedef
struct
{
const
gchar
*
padname
;
GstPad
*
target
;
GstElement
*
bin
;
GstElement
*
pipeline
;
GstIndex
*
index
;
}
dyn_link
;
static
void
dynamic_link
(
GstPadTemplate
*
templ
,
GstPad
*
newpad
,
gpointer
data
)
{
dyn_link
*
link
=
(
dyn_link
*
)
data
;
if
(
!
strcmp
(
gst_pad_get_name
(
newpad
),
link
->
padname
))
{
gst_element_set_state
(
link
->
pipeline
,
GST_STATE_PAUSED
);
gst_bin_add
(
GST_BIN
(
link
->
pipeline
),
link
->
bin
);
gst_pad_link
(
newpad
,
link
->
target
);
gst_element_set_index
(
link
->
bin
,
link
->
index
);
gst_element_set_state
(
link
->
pipeline
,
GST_STATE_PLAYING
);
}
}
static
void
setup_dynamic_linking
(
GstElement
*
pipeline
,
GstElement
*
element
,
const
gchar
*
padname
,
GstPad
*
target
,
GstElement
*
bin
,
GstIndex
*
index
)
{
dyn_link
*
link
;
link
=
g_new0
(
dyn_link
,
1
);
link
->
padname
=
g_strdup
(
padname
);
link
->
target
=
target
;
link
->
bin
=
bin
;
link
->
pipeline
=
pipeline
;
link
->
index
=
index
;
g_signal_connect
(
G_OBJECT
(
element
),
"new_pad"
,
G_CALLBACK
(
dynamic_link
),
link
);
}
static
GstElement
*
make_mpeg_systems_pipeline
(
const
gchar
*
path
,
GstIndex
*
index
)
{
GstElement
*
pipeline
;
GstElement
*
src
,
*
demux
;
pipeline
=
gst_pipeline_new
(
"pipeline"
);
src
=
gst_element_factory_make
(
"filesrc"
,
"src"
);
g_object_set
(
G_OBJECT
(
src
),
"location"
,
path
,
NULL
);
demux
=
gst_element_factory_make
(
"mpegdemux"
,
"demux"
);
gst_bin_add
(
GST_BIN
(
pipeline
),
src
);
gst_bin_add
(
GST_BIN
(
pipeline
),
demux
);
if
(
index
)
{
gst_element_set_index
(
pipeline
,
index
);
}
gst_element_link_pads
(
src
,
"src"
,
demux
,
"sink"
);
return
pipeline
;
}
static
GstElement
*
make_mpeg_decoder_pipeline
(
const
gchar
*
path
,
GstIndex
*
index
)
{
GstElement
*
pipeline
;
GstElement
*
src
,
*
demux
;
GstElement
*
video_bin
,
*
audio_bin
;
GstElement
*
video_decoder
,
*
audio_decoder
;
pipeline
=
gst_pipeline_new
(
"pipeline"
);
src
=
gst_element_factory_make
(
"filesrc"
,
"src"
);
g_object_set
(
G_OBJECT
(
src
),
"location"
,
path
,
NULL
);
demux
=
gst_element_factory_make
(
"mpegdemux"
,
"demux"
);
gst_bin_add
(
GST_BIN
(
pipeline
),
src
);
gst_bin_add
(
GST_BIN
(
pipeline
),
demux
);
gst_element_link_pads
(
src
,
"src"
,
demux
,
"sink"
);
video_bin
=
gst_bin_new
(
"video_bin"
);
video_decoder
=
gst_element_factory_make
(
"mpeg2dec"
,
"video_decoder"
);
gst_bin_add
(
GST_BIN
(
video_bin
),
video_decoder
);
setup_dynamic_linking
(
pipeline
,
demux
,
"video_00"
,
gst_element_get_pad
(
video_decoder
,
"sink"
),
video_bin
,
index
);
audio_bin
=
gst_bin_new
(
"audio_bin"
);
audio_decoder
=
gst_element_factory_make
(
"mad"
,
"audio_decoder"
);
setup_dynamic_linking
(
pipeline
,
demux
,
"audio_00"
,
gst_element_get_pad
(
audio_decoder
,
"sink"
),
audio_bin
,
index
);
gst_bin_add
(
GST_BIN
(
audio_bin
),
audio_decoder
);
if
(
index
)
{
gst_element_set_index
(
pipeline
,
index
);
}
return
pipeline
;
}
static
void
print_progress
(
GstPad
*
pad
)
{
gint
i
=
0
;
gchar
status
[
53
];
GstFormat
format
;
gboolean
res
;
gint64
value
;
gint
percent
=
0
;
status
[
0
]
=
'|'
;
format
=
GST_FORMAT_PERCENT
;
res
=
gst_pad_query
(
pad
,
GST_QUERY_POSITION
,
&
format
,
&
value
);
if
(
res
)
{
percent
=
value
/
(
2
*
GST_FORMAT_PERCENT_SCALE
);
}
for
(
i
=
0
;
i
<
percent
;
i
++
)
{
status
[
i
+
1
]
=
'='
;
}
for
(
i
=
percent
;
i
<
50
;
i
++
)
{
status
[
i
+
1
]
=
' '
;
}
status
[
51
]
=
'|'
;
status
[
52
]
=
0
;
g_print
(
"%s
\r
"
,
status
);
}
gint
main
(
gint
argc
,
gchar
*
argv
[])
{
GstElement
*
pipeline
;
GstElement
*
src
;
GstPad
*
pad
;
GstIndex
*
index
;
gint
count
=
0
;
GstEvent
*
event
;
gboolean
res
;
GstElement
*
sink
;
struct
poptOption
options
[]
=
{
{
"verbose"
,
'v'
,
POPT_ARG_NONE
|
POPT_ARGFLAG_STRIP
,
&
verbose
,
0
,
"Print index entries"
,
NULL
},
{
"quiet"
,
'q'
,
POPT_ARG_NONE
|
POPT_ARGFLAG_STRIP
,
&
quiet
,
0
,
"don't print progress bar"
,
NULL
},
POPT_TABLEEND
};
if
(
!
gst_init_check_with_popt_table
(
&
argc
,
&
argv
,
options
)
||
argc
<
3
)
{
g_print
(
"usage: %s [-v] <type> <filename>
\n
"
" type can be: 0 mpeg_systems
\n
"
" 1 mpeg_decoder
\n
"
" -v : report added index entries
\n
"
" -q : don't print progress
\n
"
,
argv
[
0
]);
return
-
1
;
}
/* create index that elements can fill */
index
=
gst_index_factory_make
(
"memindex"
);
if
(
index
)
{
if
(
verbose
)
g_signal_connect
(
G_OBJECT
(
index
),
"entry_added"
,
G_CALLBACK
(
entry_added
),
NULL
);
g_object_set
(
G_OBJECT
(
index
),
"resolver"
,
1
,
NULL
);
}
/* construct pipeline */
switch
(
atoi
(
argv
[
1
]))
{
case
0
:
pipeline
=
make_mpeg_systems_pipeline
(
argv
[
2
],
index
);
break
;
case
1
:
pipeline
=
make_mpeg_decoder_pipeline
(
argv
[
2
],
index
);
break
;
default:
g_print
(
"unknown type %d
\n
"
,
atoi
(
argv
[
1
]));
return
-
1
;
}
/* setup some default info/error handlers */
g_signal_connect
(
G_OBJECT
(
pipeline
),
"deep_notify"
,
G_CALLBACK
(
gst_element_default_deep_notify
),
NULL
);
g_signal_connect
(
G_OBJECT
(
pipeline
),
"error"
,
G_CALLBACK
(
gst_element_default_error
),
NULL
);
/* get a pad to perform progress reporting on */
src
=
gst_bin_get_by_name
(
GST_BIN
(
pipeline
),
"src"
);
pad
=
gst_element_get_pad
(
src
,
"src"
);
/* prepare for iteration */
gst_element_set_state
(
pipeline
,
GST_STATE_PLAYING
);