2001-12-23 06:03:21 +00:00
|
|
|
|
2004-01-12 04:15:46 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2001-12-23 06:03:21 +00:00
|
|
|
#include <config.h>
|
2004-01-12 04:15:46 +00:00
|
|
|
#endif
|
2001-12-23 06:03:21 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
|
|
#include "output_video.h"
|
|
|
|
#include "gstmpeg2dec.h"
|
|
|
|
|
|
|
|
|
2004-03-14 22:34:30 +00:00
|
|
|
void
|
|
|
|
new_frame (char *buf, void *data, uint64_t timestamp)
|
2001-12-23 06:03:21 +00:00
|
|
|
{
|
2004-03-14 22:34:30 +00:00
|
|
|
g_print (".");
|
2001-12-23 06:03:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-03-14 22:34:30 +00:00
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
2001-12-23 06:03:21 +00:00
|
|
|
{
|
|
|
|
int fd, count = 20000;
|
|
|
|
mpeg2dec_t *decoder;
|
|
|
|
char buffer[2048];
|
|
|
|
|
|
|
|
fd = open (argv[1], O_RDONLY);
|
|
|
|
|
|
|
|
gst_init (&argc, &argv);
|
|
|
|
mpeg2_init (decoder, new_frame, NULL);
|
|
|
|
|
|
|
|
while (read (fd, buffer, 2048) && count--) {
|
2004-03-14 22:34:30 +00:00
|
|
|
mpeg2_decode_data (decoder, buffer, buffer + 2048);
|
2001-12-23 06:03:21 +00:00
|
|
|
}
|
2004-03-14 22:34:30 +00:00
|
|
|
g_print ("\n");
|
2001-12-23 06:03:21 +00:00
|
|
|
}
|