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
668fb1cb
Commit
668fb1cb
authored
May 30, 2016
by
Thomas Volkert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtpenc: packetizer for VP9 RTP payload format (draft v2)
parent
60de31e9
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
77 additions
and
2 deletions
+77
-2
Changelog
Changelog
+1
-0
Makefile
libavformat/Makefile
+1
-0
rtpenc.c
libavformat/rtpenc.c
+14
-0
rtpenc.h
libavformat/rtpenc.h
+1
-0
rtpenc_vp9.c
libavformat/rtpenc_vp9.c
+54
-0
sdp.c
libavformat/sdp.c
+4
-0
version.h
libavformat/version.h
+2
-2
No files found.
Changelog
View file @
668fb1cb
...
...
@@ -13,6 +13,7 @@ version <next>:
- protocol blacklisting API
- MediaCodec H264 decoding
- VC-2 HQ RTP payload format (draft v1) depacketizer and packetizer
- VP9 RTP payload format (draft v2) packetizer
- AudioToolbox audio decoders
- AudioToolbox audio encoders
- coreimage filter (GPU based image filtering on OSX)
...
...
libavformat/Makefile
View file @
668fb1cb
...
...
@@ -413,6 +413,7 @@ OBJS-$(CONFIG_RTP_MUXER) += rtp.o \
rtpenc.o
\
rtpenc_vc2hq.o
\
rtpenc_vp8.o
\
rtpenc_vp9.o
\
rtpenc_xiph.o
\
avc.o
hevc.o
OBJS-$(CONFIG_RTSP_DEMUXER)
+=
rtsp.o
rtspdec.o
httpauth.o
\
...
...
libavformat/rtpenc.c
View file @
668fb1cb
...
...
@@ -75,6 +75,7 @@ static int is_supported(enum AVCodecID id)
case
AV_CODEC_ID_VORBIS
:
case
AV_CODEC_ID_THEORA
:
case
AV_CODEC_ID_VP8
:
case
AV_CODEC_ID_VP9
:
case
AV_CODEC_ID_ADPCM_G722
:
case
AV_CODEC_ID_ADPCM_G726
:
case
AV_CODEC_ID_ILBC
:
...
...
@@ -211,6 +212,16 @@ static int rtp_write_header(AVFormatContext *s1)
s
->
nal_length_size
=
(
st
->
codecpar
->
extradata
[
21
]
&
0x03
)
+
1
;
}
break
;
case
AV_CODEC_ID_VP9
:
if
(
s1
->
strict_std_compliance
>
FF_COMPLIANCE_EXPERIMENTAL
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Packetizing VP9 is experimental and its specification is "
"still in draft state. "
"Please set -strict experimental in order to enable it.
\n
"
);
ret
=
AVERROR_EXPERIMENTAL
;
goto
fail
;
}
break
;
case
AV_CODEC_ID_VORBIS
:
case
AV_CODEC_ID_THEORA
:
s
->
max_frames_per_packet
=
15
;
...
...
@@ -594,6 +605,9 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt)
case
AV_CODEC_ID_VP8
:
ff_rtp_send_vp8
(
s1
,
pkt
->
data
,
size
);
break
;
case
AV_CODEC_ID_VP9
:
ff_rtp_send_vp9
(
s1
,
pkt
->
data
,
size
);
break
;
case
AV_CODEC_ID_ILBC
:
rtp_send_ilbc
(
s1
,
pkt
->
data
,
size
);
break
;
...
...
libavformat/rtpenc.h
View file @
668fb1cb
...
...
@@ -93,6 +93,7 @@ void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size);
void
ff_rtp_send_xiph
(
AVFormatContext
*
s1
,
const
uint8_t
*
buff
,
int
size
);
void
ff_rtp_send_vc2hq
(
AVFormatContext
*
s1
,
const
uint8_t
*
buf
,
int
size
,
int
interlaced
);
void
ff_rtp_send_vp8
(
AVFormatContext
*
s1
,
const
uint8_t
*
buff
,
int
size
);
void
ff_rtp_send_vp9
(
AVFormatContext
*
s1
,
const
uint8_t
*
buff
,
int
size
);
void
ff_rtp_send_jpeg
(
AVFormatContext
*
s1
,
const
uint8_t
*
buff
,
int
size
);
const
uint8_t
*
ff_h263_find_resync_marker_reverse
(
const
uint8_t
*
av_restrict
start
,
...
...
libavformat/rtpenc_vp9.c
0 → 100644
View file @
668fb1cb
/*
* RTP packetizer for VP9 payload format (draft version 02) - experimental
* Copyright (c) 2016 Thomas Volkert <thomas@netzeal.de>
*
* 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
*/
#include "rtpenc.h"
#define RTP_VP9_DESC_REQUIRED_SIZE 1
void
ff_rtp_send_vp9
(
AVFormatContext
*
ctx
,
const
uint8_t
*
buf
,
int
size
)
{
RTPMuxContext
*
rtp_ctx
=
ctx
->
priv_data
;
int
len
;
rtp_ctx
->
timestamp
=
rtp_ctx
->
cur_timestamp
;
rtp_ctx
->
buf_ptr
=
rtp_ctx
->
buf
;
/* mark the first fragment */
*
rtp_ctx
->
buf_ptr
++
=
0x08
;
while
(
size
>
0
)
{
len
=
FFMIN
(
size
,
rtp_ctx
->
max_payload_size
-
RTP_VP9_DESC_REQUIRED_SIZE
);
if
(
len
==
size
)
{
/* mark the last fragment */
rtp_ctx
->
buf
[
0
]
|=
0x04
;
}
memcpy
(
rtp_ctx
->
buf_ptr
,
buf
,
len
);
ff_rtp_send_data
(
ctx
,
rtp_ctx
->
buf
,
len
+
RTP_VP9_DESC_REQUIRED_SIZE
,
size
==
len
);
size
-=
len
;
buf
+=
len
;
/* clear the end bit */
rtp_ctx
->
buf
[
0
]
&=
~
0x08
;
}
}
libavformat/sdp.c
View file @
668fb1cb
...
...
@@ -657,6 +657,10 @@ static char *sdp_write_media_attributes(char *buff, int size, AVStream *st, int
av_strlcatf
(
buff
,
size
,
"a=rtpmap:%d VP8/90000
\r\n
"
,
payload_type
);
break
;
case
AV_CODEC_ID_VP9
:
av_strlcatf
(
buff
,
size
,
"a=rtpmap:%d VP9/90000
\r\n
"
,
payload_type
);
break
;
case
AV_CODEC_ID_MJPEG
:
if
(
payload_type
>=
RTP_PT_PRIVATE
)
av_strlcatf
(
buff
,
size
,
"a=rtpmap:%d JPEG/90000
\r\n
"
,
...
...
libavformat/version.h
View file @
668fb1cb
...
...
@@ -32,8 +32,8 @@
// When bumping major check Ticket5467, 5421, 5451(compatibility with Chromium) for regressing
// Also please add any ticket numbers that you belive might regress here
#define LIBAVFORMAT_VERSION_MAJOR 57
#define LIBAVFORMAT_VERSION_MINOR 3
7
#define LIBAVFORMAT_VERSION_MICRO 10
1
#define LIBAVFORMAT_VERSION_MINOR 3
8
#define LIBAVFORMAT_VERSION_MICRO 10
0
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
...
...
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