summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2012-12-31 16:42:45 +0000
committerphintuka <phintuka>2012-12-31 16:42:45 +0000
commitcd2a325e0cf736e489236ed5e8b4ab1a128fb547 (patch)
tree3fb2fcb4ed8451cfa4303abaa2cb80687c7fc5da
parent84f18c7b4253b11dbdc5ea48aa9e316c169dd71e (diff)
downloadxineliboutput-cd2a325e0cf736e489236ed5e8b4ab1a128fb547.tar.gz
xineliboutput-cd2a325e0cf736e489236ed5e8b4ab1a128fb547.tar.bz2
Added mpeg2_is_sequence_header()
-rw-r--r--tools/mpeg.c13
-rw-r--r--tools/mpeg.h6
2 files changed, 17 insertions, 2 deletions
diff --git a/tools/mpeg.c b/tools/mpeg.c
index 01e4ca35..b3f58d96 100644
--- a/tools/mpeg.c
+++ b/tools/mpeg.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: mpeg.c,v 1.4 2010-02-02 22:42:09 phintuka Exp $
+ * $Id: mpeg.c,v 1.5 2012-12-31 16:42:45 phintuka Exp $
*
*/
@@ -31,6 +31,17 @@ int mpeg2_get_picture_type(const uint8_t *buf, int len)
return NO_PICTURE;
}
+int mpeg2_is_sequence_header(const uint8_t *buf, int len)
+{
+ int i;
+ for (i = 0; i < len-6; i++) {
+ if (IS_SC_SEQUENCE(buf + i)) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
int mpeg2_get_video_size(const uint8_t *buf, int len, video_size_t *size)
{
int i;
diff --git a/tools/mpeg.h b/tools/mpeg.h
index 43251b09..c8ea13c3 100644
--- a/tools/mpeg.h
+++ b/tools/mpeg.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: mpeg.h,v 1.8 2010-02-03 13:49:39 phintuka Exp $
+ * $Id: mpeg.h,v 1.9 2012-12-31 16:42:45 phintuka Exp $
*
*/
@@ -58,6 +58,10 @@ int mpeg2_get_picture_type(const uint8_t *buf, int len);
*/
int mpeg2_get_video_size(const uint8_t *buf, int len, video_size_t *size);
+/*
+ *
+ */
+int mpeg2_is_sequence_header(const uint8_t *buf, int len);
#ifdef __cplusplus
} /* extern "C" { */