Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
42d4df06
Commit
42d4df06
authored
Aug 23, 2011
by
zhentan feng
Committed by
Michael Niedermayer
Sep 07, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WTV muxer (1_extract_wtv_common_code.patch)
parent
bcc531f0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
36 deletions
+56
-36
wtv.c
libavformat/wtv.c
+31
-0
wtv.h
libavformat/wtv.h
+14
-0
wtvdec.c
libavformat/wtvdec.c
+11
-36
No files found.
libavformat/wtv.c
View file @
42d4df06
...
@@ -39,6 +39,37 @@ const ff_asf_guid ff_mediatype_video =
...
@@ -39,6 +39,37 @@ const ff_asf_guid ff_mediatype_video =
const
ff_asf_guid
ff_format_none
=
const
ff_asf_guid
ff_format_none
=
{
0xD6
,
0x17
,
0x64
,
0x0F
,
0x18
,
0xC3
,
0xD0
,
0x11
,
0xA4
,
0x3F
,
0x00
,
0xA0
,
0xC9
,
0x22
,
0x31
,
0x96
};
{
0xD6
,
0x17
,
0x64
,
0x0F
,
0x18
,
0xC3
,
0xD0
,
0x11
,
0xA4
,
0x3F
,
0x00
,
0xA0
,
0xC9
,
0x22
,
0x31
,
0x96
};
/* declare utf16le strings */
#define _ , 0,
const
uint8_t
ff_timeline_le16
[]
=
{
't'
_
'i'
_
'm'
_
'e'
_
'l'
_
'i'
_
'n'
_
'e'
,
0
};
const
uint8_t
ff_timeline_table_0_entries_Events_le16
[]
=
{
't'
_
'i'
_
'm'
_
'e'
_
'l'
_
'i'
_
'n'
_
'e'
_
'.'
_
't'
_
'a'
_
'b'
_
'l'
_
'e'
_
'.'
_
'0'
_
'.'
_
'e'
_
'n'
_
't'
_
'r'
_
'i'
_
'e'
_
's'
_
'.'
_
'E'
_
'v'
_
'e'
_
'n'
_
't'
_
's'
,
0
};
const
uint8_t
ff_table_0_entries_legacy_attrib_le16
[]
=
{
't'
_
'a'
_
'b'
_
'l'
_
'e'
_
'.'
_
'0'
_
'.'
_
'e'
_
'n'
_
't'
_
'r'
_
'i'
_
'e'
_
's'
_
'.'
_
'l'
_
'e'
_
'g'
_
'a'
_
'c'
_
'y'
_
'_'
_
'a'
_
't'
_
't'
_
'r'
_
'i'
_
'b'
,
0
};
const
uint8_t
ff_table_0_entries_time_le16
[]
=
{
't'
_
'a'
_
'b'
_
'l'
_
'e'
_
'.'
_
'0'
_
'.'
_
'e'
_
'n'
_
't'
_
'r'
_
'i'
_
'e'
_
's'
_
'.'
_
't'
_
'i'
_
'm'
_
'e'
,
0
};
#undef _
const
ff_asf_guid
ff_DSATTRIB_TRANSPORT_PROPERTIES
=
{
0x12
,
0xF6
,
0x22
,
0xB6
,
0xAD
,
0x47
,
0x71
,
0x46
,
0xAD
,
0x6C
,
0x05
,
0xA9
,
0x8E
,
0x65
,
0xDE
,
0x3A
};
const
ff_asf_guid
ff_metadata_guid
=
{
0x5A
,
0xFE
,
0xD7
,
0x6D
,
0xC8
,
0x1D
,
0x8F
,
0x4A
,
0x99
,
0x22
,
0xFA
,
0xB1
,
0x1C
,
0x38
,
0x14
,
0x53
};
const
ff_asf_guid
ff_stream2_guid
=
{
0xA2
,
0xC3
,
0xD2
,
0xC2
,
0x7E
,
0x9A
,
0xDA
,
0x11
,
0x8B
,
0xF7
,
0x00
,
0x07
,
0xE9
,
0x5E
,
0xAD
,
0x8D
};
/* Media subtypes */
const
ff_asf_guid
ff_mediasubtype_cpfilters_processed
=
{
0x28
,
0xBD
,
0xAD
,
0x46
,
0xD0
,
0x6F
,
0x96
,
0x47
,
0x93
,
0xB2
,
0x15
,
0x5C
,
0x51
,
0xDC
,
0x04
,
0x8D
};
/* Formats */
const
ff_asf_guid
ff_format_cpfilters_processed
=
{
0x6F
,
0xB3
,
0x39
,
0x67
,
0x5F
,
0x1D
,
0xC2
,
0x4A
,
0x81
,
0x92
,
0x28
,
0xBB
,
0x0E
,
0x73
,
0xD1
,
0x6A
};
const
ff_asf_guid
ff_format_waveformatex
=
{
0x81
,
0x9F
,
0x58
,
0x05
,
0x56
,
0xC3
,
0xCE
,
0x11
,
0xBF
,
0x01
,
0x00
,
0xAA
,
0x00
,
0x55
,
0x59
,
0x5A
};
const
ff_asf_guid
ff_format_mpeg2_video
=
{
0xE3
,
0x80
,
0x6D
,
0xE0
,
0x46
,
0xDB
,
0xCF
,
0x11
,
0xB4
,
0xD1
,
0x00
,
0x80
,
0x5F
,
0x6C
,
0xBB
,
0xEA
};
const
AVCodecGuid
ff_video_guids
[]
=
{
const
AVCodecGuid
ff_video_guids
[]
=
{
{
CODEC_ID_MPEG2VIDEO
,
{
0x26
,
0x80
,
0x6D
,
0xE0
,
0x46
,
0xDB
,
0xCF
,
0x11
,
0xB4
,
0xD1
,
0x00
,
0x80
,
0x5F
,
0x6C
,
0xBB
,
0xEA
}},
{
CODEC_ID_MPEG2VIDEO
,
{
0x26
,
0x80
,
0x6D
,
0xE0
,
0x46
,
0xDB
,
0xCF
,
0x11
,
0xB4
,
0xD1
,
0x00
,
0x80
,
0x5F
,
0x6C
,
0xBB
,
0xEA
}},
{
CODEC_ID_NONE
}
{
CODEC_ID_NONE
}
...
...
libavformat/wtv.h
View file @
42d4df06
...
@@ -28,6 +28,12 @@
...
@@ -28,6 +28,12 @@
#define WTV_SECTOR_BITS 12
#define WTV_SECTOR_BITS 12
#define WTV_SECTOR_SIZE (1 << WTV_SECTOR_BITS)
#define WTV_SECTOR_SIZE (1 << WTV_SECTOR_BITS)
#define WTV_BIGSECTOR_BITS 18
#define WTV_BIGSECTOR_BITS 18
#define WTV_PAD8(x) (((x) + 7) & ~7)
extern
const
uint8_t
ff_timeline_le16
[
16
];
extern
const
uint8_t
ff_timeline_table_0_entries_Events_le16
[
62
];
extern
const
uint8_t
ff_table_0_entries_legacy_attrib_le16
[
58
];
extern
const
uint8_t
ff_table_0_entries_time_le16
[
40
];
extern
const
ff_asf_guid
ff_dir_entry_guid
;
extern
const
ff_asf_guid
ff_dir_entry_guid
;
extern
const
ff_asf_guid
ff_wtv_guid
;
extern
const
ff_asf_guid
ff_wtv_guid
;
...
@@ -38,4 +44,12 @@ extern const ff_asf_guid ff_mediatype_audio;
...
@@ -38,4 +44,12 @@ extern const ff_asf_guid ff_mediatype_audio;
extern
const
ff_asf_guid
ff_mediatype_video
;
extern
const
ff_asf_guid
ff_mediatype_video
;
extern
const
ff_asf_guid
ff_format_none
;
extern
const
ff_asf_guid
ff_format_none
;
extern
const
AVCodecGuid
ff_video_guids
[];
extern
const
AVCodecGuid
ff_video_guids
[];
extern
const
ff_asf_guid
ff_DSATTRIB_TRANSPORT_PROPERTIES
;
extern
const
ff_asf_guid
ff_metadata_guid
;
extern
const
ff_asf_guid
ff_stream2_guid
;
extern
const
ff_asf_guid
ff_mediasubtype_cpfilters_processed
;
extern
const
ff_asf_guid
ff_format_cpfilters_processed
;
extern
const
ff_asf_guid
ff_format_waveformatex
;
extern
const
ff_asf_guid
ff_format_mpeg2_video
;
#endif
/* AVFORMAT_WTV_H */
#endif
/* AVFORMAT_WTV_H */
libavformat/wtvdec.c
View file @
42d4df06
...
@@ -314,10 +314,6 @@ typedef struct {
...
@@ -314,10 +314,6 @@ typedef struct {
}
WtvContext
;
}
WtvContext
;
/* WTV GUIDs */
/* WTV GUIDs */
static
const
ff_asf_guid
metadata_guid
=
{
0x5A
,
0xFE
,
0xD7
,
0x6D
,
0xC8
,
0x1D
,
0x8F
,
0x4A
,
0x99
,
0x22
,
0xFA
,
0xB1
,
0x1C
,
0x38
,
0x14
,
0x53
};
static
const
ff_asf_guid
stream2_guid
=
{
0xA2
,
0xC3
,
0xD2
,
0xC2
,
0x7E
,
0x9A
,
0xDA
,
0x11
,
0x8B
,
0xF7
,
0x00
,
0x07
,
0xE9
,
0x5E
,
0xAD
,
0x8D
};
static
const
ff_asf_guid
EVENTID_SubtitleSpanningEvent
=
static
const
ff_asf_guid
EVENTID_SubtitleSpanningEvent
=
{
0x48
,
0xC0
,
0xCE
,
0x5D
,
0xB9
,
0xD0
,
0x63
,
0x41
,
0x87
,
0x2C
,
0x4F
,
0x32
,
0x22
,
0x3B
,
0xE8
,
0x8A
};
{
0x48
,
0xC0
,
0xCE
,
0x5D
,
0xB9
,
0xD0
,
0x63
,
0x41
,
0x87
,
0x2C
,
0x4F
,
0x32
,
0x22
,
0x3B
,
0xE8
,
0x8A
};
static
const
ff_asf_guid
EVENTID_LanguageSpanningEvent
=
static
const
ff_asf_guid
EVENTID_LanguageSpanningEvent
=
...
@@ -350,8 +346,6 @@ static const ff_asf_guid mediatype_mstvcaption =
...
@@ -350,8 +346,6 @@ static const ff_asf_guid mediatype_mstvcaption =
{
0x89
,
0x8A
,
0x8B
,
0xB8
,
0x49
,
0xB0
,
0x80
,
0x4C
,
0xAD
,
0xCF
,
0x58
,
0x98
,
0x98
,
0x5E
,
0x22
,
0xC1
};
{
0x89
,
0x8A
,
0x8B
,
0xB8
,
0x49
,
0xB0
,
0x80
,
0x4C
,
0xAD
,
0xCF
,
0x58
,
0x98
,
0x98
,
0x5E
,
0x22
,
0xC1
};
/* Media subtypes */
/* Media subtypes */
static
const
ff_asf_guid
mediasubtype_cpfilters_processed
=
{
0x28
,
0xBD
,
0xAD
,
0x46
,
0xD0
,
0x6F
,
0x96
,
0x47
,
0x93
,
0xB2
,
0x15
,
0x5C
,
0x51
,
0xDC
,
0x04
,
0x8D
};
static
const
ff_asf_guid
mediasubtype_dvb_subtitle
=
static
const
ff_asf_guid
mediasubtype_dvb_subtitle
=
{
0xC3
,
0xCB
,
0xFF
,
0x34
,
0xB3
,
0xD5
,
0x71
,
0x41
,
0x90
,
0x02
,
0xD4
,
0xC6
,
0x03
,
0x01
,
0x69
,
0x7F
};
{
0xC3
,
0xCB
,
0xFF
,
0x34
,
0xB3
,
0xD5
,
0x71
,
0x41
,
0x90
,
0x02
,
0xD4
,
0xC6
,
0x03
,
0x01
,
0x69
,
0x7F
};
static
const
ff_asf_guid
mediasubtype_teletext
=
static
const
ff_asf_guid
mediasubtype_teletext
=
...
@@ -362,14 +356,8 @@ static const ff_asf_guid mediasubtype_mpeg2_sections =
...
@@ -362,14 +356,8 @@ static const ff_asf_guid mediasubtype_mpeg2_sections =
{
0x79
,
0x85
,
0x9F
,
0x4A
,
0xF8
,
0x6B
,
0x92
,
0x43
,
0x8A
,
0x6D
,
0xD2
,
0xDD
,
0x09
,
0xFA
,
0x78
,
0x61
};
{
0x79
,
0x85
,
0x9F
,
0x4A
,
0xF8
,
0x6B
,
0x92
,
0x43
,
0x8A
,
0x6D
,
0xD2
,
0xDD
,
0x09
,
0xFA
,
0x78
,
0x61
};
/* Formats */
/* Formats */
static
const
ff_asf_guid
format_cpfilters_processed
=
{
0x6F
,
0xB3
,
0x39
,
0x67
,
0x5F
,
0x1D
,
0xC2
,
0x4A
,
0x81
,
0x92
,
0x28
,
0xBB
,
0x0E
,
0x73
,
0xD1
,
0x6A
};
static
const
ff_asf_guid
format_waveformatex
=
{
0x81
,
0x9F
,
0x58
,
0x05
,
0x56
,
0xC3
,
0xCE
,
0x11
,
0xBF
,
0x01
,
0x00
,
0xAA
,
0x00
,
0x55
,
0x59
,
0x5A
};
static
const
ff_asf_guid
format_videoinfo2
=
static
const
ff_asf_guid
format_videoinfo2
=
{
0xA0
,
0x76
,
0x2A
,
0xF7
,
0x0A
,
0xEB
,
0xD0
,
0x11
,
0xAC
,
0xE4
,
0x00
,
0x00
,
0xC0
,
0xCC
,
0x16
,
0xBA
};
{
0xA0
,
0x76
,
0x2A
,
0xF7
,
0x0A
,
0xEB
,
0xD0
,
0x11
,
0xAC
,
0xE4
,
0x00
,
0x00
,
0xC0
,
0xCC
,
0x16
,
0xBA
};
static
const
ff_asf_guid
format_mpeg2_video
=
{
0xE3
,
0x80
,
0x6D
,
0xE0
,
0x46
,
0xDB
,
0xCF
,
0x11
,
0xB4
,
0xD1
,
0x00
,
0x80
,
0x5F
,
0x6C
,
0xBB
,
0xEA
};
static
int
read_probe
(
AVProbeData
*
p
)
static
int
read_probe
(
AVProbeData
*
p
)
{
{
...
@@ -510,7 +498,7 @@ static void parse_legacy_attrib(AVFormatContext *s, AVIOContext *pb)
...
@@ -510,7 +498,7 @@ static void parse_legacy_attrib(AVFormatContext *s, AVIOContext *pb)
length
=
avio_rl32
(
pb
);
length
=
avio_rl32
(
pb
);
if
(
!
length
)
if
(
!
length
)
break
;
break
;
if
(
ff_guidcmp
(
&
guid
,
metadata_guid
))
{
if
(
ff_guidcmp
(
&
guid
,
ff_
metadata_guid
))
{
av_log
(
s
,
AV_LOG_WARNING
,
"unknown guid "
FF_PRI_GUID
", expected metadata_guid; "
av_log
(
s
,
AV_LOG_WARNING
,
"unknown guid "
FF_PRI_GUID
", expected metadata_guid; "
"remaining metadata entries ignored
\n
"
,
FF_ARG_GUID
(
guid
));
"remaining metadata entries ignored
\n
"
,
FF_ARG_GUID
(
guid
));
break
;
break
;
...
@@ -600,8 +588,8 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid,
...
@@ -600,8 +588,8 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid,
{
{
WtvContext
*
wtv
=
s
->
priv_data
;
WtvContext
*
wtv
=
s
->
priv_data
;
AVIOContext
*
pb
=
wtv
->
pb
;
AVIOContext
*
pb
=
wtv
->
pb
;
if
(
!
ff_guidcmp
(
subtype
,
mediasubtype_cpfilters_processed
)
&&
if
(
!
ff_guidcmp
(
subtype
,
ff_
mediasubtype_cpfilters_processed
)
&&
!
ff_guidcmp
(
formattype
,
format_cpfilters_processed
))
{
!
ff_guidcmp
(
formattype
,
f
f_f
ormat_cpfilters_processed
))
{
ff_asf_guid
actual_subtype
;
ff_asf_guid
actual_subtype
;
ff_asf_guid
actual_formattype
;
ff_asf_guid
actual_formattype
;
...
@@ -623,7 +611,7 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid,
...
@@ -623,7 +611,7 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid,
st
=
new_stream
(
s
,
st
,
sid
,
AVMEDIA_TYPE_AUDIO
);
st
=
new_stream
(
s
,
st
,
sid
,
AVMEDIA_TYPE_AUDIO
);
if
(
!
st
)
if
(
!
st
)
return
NULL
;
return
NULL
;
if
(
!
ff_guidcmp
(
formattype
,
format_waveformatex
))
{
if
(
!
ff_guidcmp
(
formattype
,
f
f_f
ormat_waveformatex
))
{
int
ret
=
ff_get_wav_header
(
pb
,
st
->
codec
,
size
);
int
ret
=
ff_get_wav_header
(
pb
,
st
->
codec
,
size
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
NULL
;
return
NULL
;
...
@@ -653,7 +641,7 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid,
...
@@ -653,7 +641,7 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid,
if
(
!
ff_guidcmp
(
formattype
,
format_videoinfo2
))
{
if
(
!
ff_guidcmp
(
formattype
,
format_videoinfo2
))
{
int
consumed
=
parse_videoinfoheader2
(
s
,
st
);
int
consumed
=
parse_videoinfoheader2
(
s
,
st
);
avio_skip
(
pb
,
FFMAX
(
size
-
consumed
,
0
));
avio_skip
(
pb
,
FFMAX
(
size
-
consumed
,
0
));
}
else
if
(
!
ff_guidcmp
(
formattype
,
format_mpeg2_video
))
{
}
else
if
(
!
ff_guidcmp
(
formattype
,
f
f_f
ormat_mpeg2_video
))
{
int
consumed
=
parse_videoinfoheader2
(
s
,
st
);
int
consumed
=
parse_videoinfoheader2
(
s
,
st
);
avio_skip
(
pb
,
FFMAX
(
size
-
consumed
,
0
));
avio_skip
(
pb
,
FFMAX
(
size
-
consumed
,
0
));
}
else
{
}
else
{
...
@@ -746,7 +734,7 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
...
@@ -746,7 +734,7 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
parse_media_type
(
s
,
0
,
sid
,
mediatype
,
subtype
,
formattype
,
size
);
parse_media_type
(
s
,
0
,
sid
,
mediatype
,
subtype
,
formattype
,
size
);
consumed
+=
92
+
size
;
consumed
+=
92
+
size
;
}
}
}
else
if
(
!
ff_guidcmp
(
g
,
stream2_guid
))
{
}
else
if
(
!
ff_guidcmp
(
g
,
ff_
stream2_guid
))
{
int
stream_index
=
ff_find_stream_index
(
s
,
sid
);
int
stream_index
=
ff_find_stream_index
(
s
,
sid
);
if
(
stream_index
>=
0
&&
!
((
WtvStream
*
)
s
->
streams
[
stream_index
]
->
priv_data
)
->
seen_data
)
{
if
(
stream_index
>=
0
&&
!
((
WtvStream
*
)
s
->
streams
[
stream_index
]
->
priv_data
)
->
seen_data
)
{
ff_asf_guid
mediatype
,
subtype
,
formattype
;
ff_asf_guid
mediatype
,
subtype
,
formattype
;
...
@@ -835,7 +823,6 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
...
@@ -835,7 +823,6 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
if
(
wtv
->
epoch
==
AV_NOPTS_VALUE
||
wtv
->
pts
<
wtv
->
epoch
)
if
(
wtv
->
epoch
==
AV_NOPTS_VALUE
||
wtv
->
pts
<
wtv
->
epoch
)
wtv
->
epoch
=
wtv
->
pts
;
wtv
->
epoch
=
wtv
->
pts
;
if
(
mode
==
SEEK_TO_PTS
&&
wtv
->
pts
>=
seekts
)
{
if
(
mode
==
SEEK_TO_PTS
&&
wtv
->
pts
>=
seekts
)
{
#define WTV_PAD8(x) (((x) + 7) & ~7)
avio_skip
(
pb
,
WTV_PAD8
(
len
)
-
consumed
);
avio_skip
(
pb
,
WTV_PAD8
(
len
)
-
consumed
);
return
0
;
return
0
;
}
}
...
@@ -854,7 +841,7 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
...
@@ -854,7 +841,7 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
}
else
if
(
}
else
if
(
!
ff_guidcmp
(
g
,
/* DSATTRIB_CAPTURE_STREAMTIME */
(
const
ff_asf_guid
){
0x14
,
0x56
,
0x1A
,
0x0C
,
0xCD
,
0x30
,
0x40
,
0x4F
,
0xBC
,
0xBF
,
0xD0
,
0x3E
,
0x52
,
0x30
,
0x62
,
0x07
})
||
!
ff_guidcmp
(
g
,
/* DSATTRIB_CAPTURE_STREAMTIME */
(
const
ff_asf_guid
){
0x14
,
0x56
,
0x1A
,
0x0C
,
0xCD
,
0x30
,
0x40
,
0x4F
,
0xBC
,
0xBF
,
0xD0
,
0x3E
,
0x52
,
0x30
,
0x62
,
0x07
})
||
!
ff_guidcmp
(
g
,
/* DSATTRIB_PicSampleSeq */
(
const
ff_asf_guid
){
0x02
,
0xAE
,
0x5B
,
0x2F
,
0x8F
,
0x7B
,
0x60
,
0x4F
,
0x82
,
0xD6
,
0xE4
,
0xEA
,
0x2F
,
0x1F
,
0x4C
,
0x99
})
||
!
ff_guidcmp
(
g
,
/* DSATTRIB_PicSampleSeq */
(
const
ff_asf_guid
){
0x02
,
0xAE
,
0x5B
,
0x2F
,
0x8F
,
0x7B
,
0x60
,
0x4F
,
0x82
,
0xD6
,
0xE4
,
0xEA
,
0x2F
,
0x1F
,
0x4C
,
0x99
})
||
!
ff_guidcmp
(
g
,
/* DSATTRIB_TRANSPORT_PROPERTIES */
(
const
ff_asf_guid
){
0x12
,
0xF6
,
0x22
,
0xB6
,
0xAD
,
0x47
,
0x71
,
0x46
,
0xAD
,
0x6C
,
0x05
,
0xA9
,
0x8E
,
0x65
,
0xDE
,
0x3A
}
)
||
!
ff_guidcmp
(
g
,
/* DSATTRIB_TRANSPORT_PROPERTIES */
ff_DSATTRIB_TRANSPORT_PROPERTIES
)
||
!
ff_guidcmp
(
g
,
/* dvr_ms_vid_frame_rep_data */
(
const
ff_asf_guid
){
0xCC
,
0x32
,
0x64
,
0xDD
,
0x29
,
0xE2
,
0xDB
,
0x40
,
0x80
,
0xF6
,
0xD2
,
0x63
,
0x28
,
0xD2
,
0x76
,
0x1F
})
||
!
ff_guidcmp
(
g
,
/* dvr_ms_vid_frame_rep_data */
(
const
ff_asf_guid
){
0xCC
,
0x32
,
0x64
,
0xDD
,
0x29
,
0xE2
,
0xDB
,
0x40
,
0x80
,
0xF6
,
0xD2
,
0x63
,
0x28
,
0xD2
,
0x76
,
0x1F
})
||
!
ff_guidcmp
(
g
,
/* EVENTID_ChannelChangeSpanningEvent */
(
const
ff_asf_guid
){
0xE5
,
0xC5
,
0x67
,
0x90
,
0x5C
,
0x4C
,
0x05
,
0x42
,
0x86
,
0xC8
,
0x7A
,
0xFE
,
0x20
,
0xFE
,
0x1E
,
0xFA
})
||
!
ff_guidcmp
(
g
,
/* EVENTID_ChannelChangeSpanningEvent */
(
const
ff_asf_guid
){
0xE5
,
0xC5
,
0x67
,
0x90
,
0x5C
,
0x4C
,
0x05
,
0x42
,
0x86
,
0xC8
,
0x7A
,
0xFE
,
0x20
,
0xFE
,
0x1E
,
0xFA
})
||
!
ff_guidcmp
(
g
,
/* EVENTID_ChannelInfoSpanningEvent */
(
const
ff_asf_guid
){
0x80
,
0x6D
,
0xF3
,
0x41
,
0x32
,
0x41
,
0xC2
,
0x4C
,
0xB1
,
0x21
,
0x01
,
0xA4
,
0x32
,
0x19
,
0xD8
,
0x1B
})
||
!
ff_guidcmp
(
g
,
/* EVENTID_ChannelInfoSpanningEvent */
(
const
ff_asf_guid
){
0x80
,
0x6D
,
0xF3
,
0x41
,
0x32
,
0x41
,
0xC2
,
0x4C
,
0xB1
,
0x21
,
0x01
,
0xA4
,
0x32
,
0x19
,
0xD8
,
0x1B
})
||
...
@@ -879,18 +866,6 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
...
@@ -879,18 +866,6 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
return
AVERROR_EOF
;
return
AVERROR_EOF
;
}
}
/* declare utf16le strings */
#define _ , 0,
static
const
uint8_t
timeline_le16
[]
=
{
't'
_
'i'
_
'm'
_
'e'
_
'l'
_
'i'
_
'n'
_
'e'
,
0
};
static
const
uint8_t
table_0_entries_legacy_attrib_le16
[]
=
{
't'
_
'a'
_
'b'
_
'l'
_
'e'
_
'.'
_
'0'
_
'.'
_
'e'
_
'n'
_
't'
_
'r'
_
'i'
_
'e'
_
's'
_
'.'
_
'l'
_
'e'
_
'g'
_
'a'
_
'c'
_
'y'
_
'_'
_
'a'
_
't'
_
't'
_
'r'
_
'i'
_
'b'
,
0
};
static
const
uint8_t
table_0_entries_time_le16
[]
=
{
't'
_
'a'
_
'b'
_
'l'
_
'e'
_
'.'
_
'0'
_
'.'
_
'e'
_
'n'
_
't'
_
'r'
_
'i'
_
'e'
_
's'
_
'.'
_
't'
_
'i'
_
'm'
_
'e'
,
0
};
static
const
uint8_t
timeline_table_0_entries_Events_le16
[]
=
{
't'
_
'i'
_
'm'
_
'e'
_
'l'
_
'i'
_
'n'
_
'e'
_
'.'
_
't'
_
'a'
_
'b'
_
'l'
_
'e'
_
'.'
_
'0'
_
'.'
_
'e'
_
'n'
_
't'
_
'r'
_
'i'
_
'e'
_
's'
_
'.'
_
'E'
_
'v'
_
'e'
_
'n'
_
't'
_
's'
,
0
};
#undef _
static
int
read_header
(
AVFormatContext
*
s
,
AVFormatParameters
*
ap
)
static
int
read_header
(
AVFormatContext
*
s
,
AVFormatParameters
*
ap
)
{
{
WtvContext
*
wtv
=
s
->
priv_data
;
WtvContext
*
wtv
=
s
->
priv_data
;
...
@@ -920,7 +895,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
...
@@ -920,7 +895,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
/* parse chunks up until first data chunk */
/* parse chunks up until first data chunk */
wtv
->
pb
=
wtvfile_open
(
s
,
root
,
root_size
,
timeline_le16
);
wtv
->
pb
=
wtvfile_open
(
s
,
root
,
root_size
,
ff_
timeline_le16
);
if
(
!
wtv
->
pb
)
{
if
(
!
wtv
->
pb
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"timeline data missing
\n
"
);
av_log
(
s
,
AV_LOG_ERROR
,
"timeline data missing
\n
"
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
...
@@ -934,7 +909,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
...
@@ -934,7 +909,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
timeline_pos
=
avio_tell
(
s
->
pb
);
// save before opening another file
timeline_pos
=
avio_tell
(
s
->
pb
);
// save before opening another file
/* read metadata */
/* read metadata */
pb
=
wtvfile_open
(
s
,
root
,
root_size
,
table_0_entries_legacy_attrib_le16
);
pb
=
wtvfile_open
(
s
,
root
,
root_size
,
ff_
table_0_entries_legacy_attrib_le16
);
if
(
pb
)
{
if
(
pb
)
{
parse_legacy_attrib
(
s
,
pb
);
parse_legacy_attrib
(
s
,
pb
);
wtvfile_close
(
pb
);
wtvfile_close
(
pb
);
...
@@ -943,7 +918,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
...
@@ -943,7 +918,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
/* read seek index */
/* read seek index */
if
(
s
->
nb_streams
)
{
if
(
s
->
nb_streams
)
{
AVStream
*
st
=
s
->
streams
[
0
];
AVStream
*
st
=
s
->
streams
[
0
];
pb
=
wtvfile_open
(
s
,
root
,
root_size
,
table_0_entries_time_le16
);
pb
=
wtvfile_open
(
s
,
root
,
root_size
,
ff_
table_0_entries_time_le16
);
if
(
pb
)
{
if
(
pb
)
{
while
(
1
)
{
while
(
1
)
{
uint64_t
timestamp
=
avio_rl64
(
pb
);
uint64_t
timestamp
=
avio_rl64
(
pb
);
...
@@ -956,7 +931,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
...
@@ -956,7 +931,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
wtvfile_close
(
pb
);
wtvfile_close
(
pb
);
if
(
wtv
->
nb_index_entries
)
{
if
(
wtv
->
nb_index_entries
)
{
pb
=
wtvfile_open
(
s
,
root
,
root_size
,
timeline_table_0_entries_Events_le16
);
pb
=
wtvfile_open
(
s
,
root
,
root_size
,
ff_
timeline_table_0_entries_Events_le16
);
if
(
pb
)
{
if
(
pb
)
{
int
i
;
int
i
;
while
(
1
)
{
while
(
1
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment