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
00332e0a
Commit
00332e0a
authored
Oct 09, 2015
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrapped_avframe: Initial implementation
parent
c3e5c47b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
85 additions
and
1 deletion
+85
-1
Makefile
libavcodec/Makefile
+1
-0
allcodecs.c
libavcodec/allcodecs.c
+1
-0
avcodec.h
libavcodec/avcodec.h
+1
-0
codec_desc.c
libavcodec/codec_desc.c
+7
-0
version.h
libavcodec/version.h
+1
-1
wrapped_avframe.c
libavcodec/wrapped_avframe.c
+74
-0
No files found.
libavcodec/Makefile
View file @
00332e0a
...
...
@@ -472,6 +472,7 @@ OBJS-$(CONFIG_WMV2_ENCODER) += wmv2enc.o wmv2.o \
msmpeg4.o
msmpeg4enc.o
msmpeg4data.o
OBJS-$(CONFIG_WNV1_DECODER)
+=
wnv1.o
OBJS-$(CONFIG_WS_SND1_DECODER)
+=
ws-snd1.o
OBJS-$(CONFIG_WRAPPED_AVFRAME_ENCODER)
+=
wrapped_avframe.o
OBJS-$(CONFIG_XAN_DPCM_DECODER)
+=
dpcm.o
OBJS-$(CONFIG_XAN_WC3_DECODER)
+=
xan.o
OBJS-$(CONFIG_XAN_WC4_DECODER)
+=
xxan.o
...
...
libavcodec/allcodecs.c
View file @
00332e0a
...
...
@@ -292,6 +292,7 @@ void avcodec_register_all(void)
REGISTER_DECODER
(
VP9
,
vp9
);
REGISTER_DECODER
(
VQA
,
vqa
);
REGISTER_DECODER
(
WEBP
,
webp
);
REGISTER_ENCODER
(
WRAPPED_AVFRAME
,
wrapped_avframe
);
REGISTER_ENCDEC
(
WMV1
,
wmv1
);
REGISTER_ENCDEC
(
WMV2
,
wmv2
);
REGISTER_DECODER
(
WMV3
,
wmv3
);
...
...
libavcodec/avcodec.h
View file @
00332e0a
...
...
@@ -477,6 +477,7 @@ enum AVCodecID {
AV_CODEC_ID_MPEG4SYSTEMS
=
0x20001
,
/**< _FAKE_ codec to indicate a MPEG-4 Systems
* stream (only used by libavformat) */
AV_CODEC_ID_FFMETADATA
=
0x21000
,
///< Dummy codec for streams containing only metadata information.
AV_CODEC_ID_WRAPPED_AVFRAME
=
0x21001
,
///< Passthrough codec, AVFrames wrapped in AVPacket
};
/**
...
...
libavcodec/codec_desc.c
View file @
00332e0a
...
...
@@ -1169,6 +1169,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Screenpresso"
),
.
props
=
AV_CODEC_PROP_LOSSLESS
,
},
{
.
id
=
AV_CODEC_ID_WRAPPED_AVFRAME
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
name
=
"wrapped_avframe"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"AVFrame to AVPacket passthrough"
),
.
props
=
AV_CODEC_PROP_LOSSLESS
,
},
/* image codecs */
{
...
...
libavcodec/version.h
View file @
00332e0a
...
...
@@ -29,7 +29,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR
3
#define LIBAVCODEC_VERSION_MINOR
4
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
...
...
libavcodec/wrapped_avframe.c
0 → 100644
View file @
00332e0a
/*
* AVFrame wrapper
* Copyright (c) 2015 Luca Barbato
*
* This file is part of Libav.
*
* Libav 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.
*
* Libav 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 Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* Simple wrapper to store an AVFrame and forward it as AVPacket.
*/
#include "avcodec.h"
#include "internal.h"
#include "libavutil/internal.h"
#include "libavutil/frame.h"
#include "libavutil/buffer.h"
#include "libavutil/pixdesc.h"
static
void
wrapped_avframe_release_buffer
(
void
*
unused
,
uint8_t
*
data
)
{
AVFrame
*
frame
=
(
AVFrame
*
)
data
;
av_frame_free
(
&
frame
);
}
static
int
wrapped_avframe_encode
(
AVCodecContext
*
avctx
,
AVPacket
*
pkt
,
const
AVFrame
*
frame
,
int
*
got_packet
)
{
AVFrame
*
wrapped
=
av_frame_clone
(
frame
);
int
ret
;
if
(
!
wrapped
)
return
AVERROR
(
ENOMEM
);
pkt
->
buf
=
av_buffer_create
((
uint8_t
*
)
wrapped
,
sizeof
(
*
wrapped
),
wrapped_avframe_release_buffer
,
NULL
,
AV_BUFFER_FLAG_READONLY
);
if
(
!
pkt
->
buf
)
{
av_frame_free
(
&
wrapped
);
return
AVERROR
(
ENOMEM
);
}
pkt
->
data
=
(
uint8_t
*
)
wrapped
;
pkt
->
size
=
sizeof
(
*
wrapped
);
pkt
->
flags
|=
AV_PKT_FLAG_KEY
;
*
got_packet
=
1
;
return
0
;
}
AVCodec
ff_wrapped_avframe_encoder
=
{
.
name
=
"wrapped_avframe"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"AVFrame to AVPacket passthrough"
),
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
id
=
AV_CODEC_ID_WRAPPED_AVFRAME
,
.
encode2
=
wrapped_avframe_encode
,
.
caps_internal
=
FF_CODEC_CAP_INIT_THREADSAFE
,
};
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