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
587874ef
Commit
587874ef
authored
Oct 24, 2012
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rawdec: remove ff_raw_read_header
It is not used anymore and is a kludge.
parent
2ef4d586
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
78 deletions
+0
-78
rawdec.c
libavformat/rawdec.c
+0
-70
rawdec.h
libavformat/rawdec.h
+0
-8
No files found.
libavformat/rawdec.c
View file @
587874ef
...
...
@@ -28,76 +28,6 @@
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
/* raw input */
int
ff_raw_read_header
(
AVFormatContext
*
s
)
{
AVStream
*
st
;
enum
AVCodecID
id
;
st
=
avformat_new_stream
(
s
,
NULL
);
if
(
!
st
)
return
AVERROR
(
ENOMEM
);
id
=
s
->
iformat
->
raw_codec_id
;
if
(
id
==
AV_CODEC_ID_RAWVIDEO
)
{
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_VIDEO
;
}
else
{
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_AUDIO
;
}
st
->
codec
->
codec_id
=
id
;
switch
(
st
->
codec
->
codec_type
)
{
case
AVMEDIA_TYPE_AUDIO
:
{
RawAudioDemuxerContext
*
s1
=
s
->
priv_data
;
st
->
codec
->
channels
=
1
;
if
(
id
==
AV_CODEC_ID_ADPCM_G722
)
st
->
codec
->
sample_rate
=
16000
;
if
(
s1
&&
s1
->
sample_rate
)
st
->
codec
->
sample_rate
=
s1
->
sample_rate
;
if
(
s1
&&
s1
->
channels
)
st
->
codec
->
channels
=
s1
->
channels
;
st
->
codec
->
bits_per_coded_sample
=
av_get_bits_per_sample
(
st
->
codec
->
codec_id
);
assert
(
st
->
codec
->
bits_per_coded_sample
>
0
);
st
->
codec
->
block_align
=
st
->
codec
->
bits_per_coded_sample
*
st
->
codec
->
channels
/
8
;
avpriv_set_pts_info
(
st
,
64
,
1
,
st
->
codec
->
sample_rate
);
break
;
}
case
AVMEDIA_TYPE_VIDEO
:
{
FFRawVideoDemuxerContext
*
s1
=
s
->
priv_data
;
int
width
=
0
,
height
=
0
,
ret
=
0
;
enum
AVPixelFormat
pix_fmt
;
AVRational
framerate
;
if
(
s1
->
video_size
&&
(
ret
=
av_parse_video_size
(
&
width
,
&
height
,
s1
->
video_size
))
<
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Couldn't parse video size.
\n
"
);
goto
fail
;
}
if
((
pix_fmt
=
av_get_pix_fmt
(
s1
->
pixel_format
))
==
AV_PIX_FMT_NONE
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"No such pixel format: %s.
\n
"
,
s1
->
pixel_format
);
ret
=
AVERROR
(
EINVAL
);
goto
fail
;
}
if
((
ret
=
av_parse_video_rate
(
&
framerate
,
s1
->
framerate
))
<
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Could not parse framerate: %s.
\n
"
,
s1
->
framerate
);
goto
fail
;
}
avpriv_set_pts_info
(
st
,
64
,
framerate
.
den
,
framerate
.
num
);
st
->
codec
->
width
=
width
;
st
->
codec
->
height
=
height
;
st
->
codec
->
pix_fmt
=
pix_fmt
;
fail:
return
ret
;
}
default:
return
-
1
;
}
return
0
;
}
#define RAW_PACKET_SIZE 1024
int
ff_raw_read_partial_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
...
...
libavformat/rawdec.h
View file @
587874ef
...
...
@@ -26,12 +26,6 @@
#include "libavutil/log.h"
#include "libavutil/opt.h"
typedef
struct
RawAudioDemuxerContext
{
AVClass
*
class
;
int
sample_rate
;
int
channels
;
}
RawAudioDemuxerContext
;
typedef
struct
FFRawVideoDemuxerContext
{
const
AVClass
*
class
;
/**< Class for private options. */
char
*
video_size
;
/**< String describing video size, set by a private option. */
...
...
@@ -41,8 +35,6 @@ typedef struct FFRawVideoDemuxerContext {
extern
const
AVOption
ff_rawvideo_options
[];
int
ff_raw_read_header
(
AVFormatContext
*
s
);
int
ff_raw_read_partial_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
);
int
ff_raw_audio_read_header
(
AVFormatContext
*
s
);
...
...
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