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
3d0994be
Commit
3d0994be
authored
Jan 06, 2013
by
Peter Ross
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Megalux Frame demuxer
parent
e27c470f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
108 additions
and
0 deletions
+108
-0
Changelog
Changelog
+1
-0
general.texi
doc/general.texi
+2
-0
Makefile
libavformat/Makefile
+1
-0
allformats.c
libavformat/allformats.c
+1
-0
frmdec.c
libavformat/frmdec.c
+103
-0
No files found.
Changelog
View file @
3d0994be
...
...
@@ -345,6 +345,7 @@ easier to use. The changes are:
- Simple segmenting muxer
- Indeo 4 decoder
- SMJPEG demuxer
- Megalux Frame demuxer
version 0.8:
...
...
doc/general.texi
View file @
3d0994be
...
...
@@ -253,6 +253,8 @@ library:
@tab Used in Sim City 3000; file extension .xa.
@item MD Studio @tab @tab X
@item Metal Gear Solid: The Twin Snakes @tab @tab X
@item Megalux Frame @tab @tab X
@tab Used by Megalux Ultimate Paint
@item Mobotix .mxg @tab @tab X
@item Monkey's Audio @tab @tab X
@item Motion Pixels MVI @tab @tab X
...
...
libavformat/Makefile
View file @
3d0994be
...
...
@@ -136,6 +136,7 @@ OBJS-$(CONFIG_FLV_MUXER) += flvenc.o avc.o
OBJS-$(CONFIG_FOURXM_DEMUXER)
+=
4xm.o
OBJS-$(CONFIG_FRAMECRC_MUXER)
+=
framecrcenc.o
framehash.o
OBJS-$(CONFIG_FRAMEMD5_MUXER)
+=
md5enc.o
framehash.o
OBJS-$(CONFIG_FRM_DEMUXER)
+=
frmdec.o
OBJS-$(CONFIG_GIF_MUXER)
+=
gif.o
OBJS-$(CONFIG_GIF_DEMUXER)
+=
gifdec.o
OBJS-$(CONFIG_GSM_DEMUXER)
+=
gsmdec.o
...
...
libavformat/allformats.c
View file @
3d0994be
...
...
@@ -122,6 +122,7 @@ void av_register_all(void)
REGISTER_DEMUXER
(
FOURXM
,
fourxm
);
REGISTER_MUXER
(
FRAMECRC
,
framecrc
);
REGISTER_MUXER
(
FRAMEMD5
,
framemd5
);
REGISTER_DEMUXER
(
FRM
,
frm
);
REGISTER_MUXDEMUX
(
G722
,
g722
);
REGISTER_MUXDEMUX
(
G723_1
,
g723_1
);
REGISTER_DEMUXER
(
G729
,
g729
);
...
...
libavformat/frmdec.c
0 → 100644
View file @
3d0994be
/*
* Megalux Frame demuxer
* Copyright (c) 2010 Peter Ross <pross@xvid.org>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* Megalux Frame demuxer
*/
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "riff.h"
static
const
AVCodecTag
frm_pix_fmt_tags
[]
=
{
{
PIX_FMT_RGB555
,
1
},
{
PIX_FMT_BGR32
,
2
},
{
PIX_FMT_RGB24
,
3
},
{
PIX_FMT_BGR0
,
4
},
{
PIX_FMT_BGR0
,
5
},
};
typedef
struct
{
int
count
;
}
FrmContext
;
static
int
frm_read_probe
(
AVProbeData
*
p
)
{
if
(
p
->
buf_size
>
8
&&
p
->
buf
[
0
]
==
'F'
&&
p
->
buf
[
1
]
==
'R'
&&
p
->
buf
[
2
]
==
'M'
&&
AV_RL16
(
&
p
->
buf
[
4
])
&&
AV_RL16
(
&
p
->
buf
[
6
]))
return
AVPROBE_SCORE_MAX
/
2
;
return
0
;
}
static
int
frm_read_header
(
AVFormatContext
*
avctx
)
{
AVIOContext
*
pb
=
avctx
->
pb
;
AVStream
*
st
=
avformat_new_stream
(
avctx
,
0
);
if
(
!
st
)
return
AVERROR
(
ENOMEM
);
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_VIDEO
;
st
->
codec
->
codec_id
=
AV_CODEC_ID_RAWVIDEO
;
avio_skip
(
pb
,
3
);
st
->
codec
->
pix_fmt
=
ff_codec_get_id
(
frm_pix_fmt_tags
,
avio_r8
(
pb
));
if
(
!
st
->
codec
->
pix_fmt
)
return
AVERROR_INVALIDDATA
;
st
->
codec
->
codec_tag
=
0
;
st
->
codec
->
width
=
avio_rl16
(
pb
);
st
->
codec
->
height
=
avio_rl16
(
pb
);
return
0
;
}
static
int
frm_read_packet
(
AVFormatContext
*
avctx
,
AVPacket
*
pkt
)
{
FrmContext
*
s
=
avctx
->
priv_data
;
AVCodecContext
*
stc
=
avctx
->
streams
[
0
]
->
codec
;
int
packet_size
,
ret
;
if
(
s
->
count
)
return
AVERROR_EOF
;
packet_size
=
avpicture_get_size
(
stc
->
pix_fmt
,
stc
->
width
,
stc
->
height
);
if
(
packet_size
<
0
)
return
AVERROR_INVALIDDATA
;
ret
=
av_get_packet
(
avctx
->
pb
,
pkt
,
packet_size
);
if
(
ret
<
0
)
return
ret
;
pkt
->
stream_index
=
0
;
s
->
count
++
;
return
0
;
}
AVInputFormat
ff_frm_demuxer
=
{
.
name
=
"frm"
,
.
priv_data_size
=
sizeof
(
FrmContext
),
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Megalux Frame"
),
.
read_probe
=
frm_read_probe
,
.
read_header
=
frm_read_header
,
.
read_packet
=
frm_read_packet
,
};
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