1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  rtmp: Add a new option 'rtmp_pageurl'
  doc: Update the description of the rtmp_tcurl option
  rtmp: Make the description of the rtmp_tcurl option more generic
  libfdk-aacenc: add LATM/LOAS encapsulation support
  sctp: add port missing error message
  tcp: add port missing error message
  avfilter: Fix printf format string conversion specifier

Conflicts:
	libavcodec/version.h
	libavfilter/avfilter.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-07-25 22:00:06 +02:00
commit f7d4e26c6a
6 changed files with 38 additions and 7 deletions

View File

@ -259,6 +259,10 @@ playpath. If a live stream of that name is not found, it plays the
recorded stream. The other possible values are @code{live} and recorded stream. The other possible values are @code{live} and
@code{recorded}. @code{recorded}.
@item rtmp_pageurl
URL of the web page in which the media was embedded. By default no
value will be sent.
@item rtmp_playpath @item rtmp_playpath
Stream identifier to play or to publish. This option overrides the Stream identifier to play or to publish. This option overrides the
parameter specified in the URI. parameter specified in the URI.
@ -267,7 +271,7 @@ parameter specified in the URI.
URL of the SWF player for the media. By default no value will be sent. URL of the SWF player for the media. By default no value will be sent.
@item rtmp_tcurl @item rtmp_tcurl
URL of the target stream. URL of the target stream. Defaults to proto://host[:port]/app.
@end table @end table

View File

@ -33,6 +33,8 @@ typedef struct AACContext {
int afterburner; int afterburner;
int eld_sbr; int eld_sbr;
int signaling; int signaling;
int latm;
int header_period;
AudioFrameQueue afq; AudioFrameQueue afq;
} AACContext; } AACContext;
@ -45,6 +47,8 @@ static const AVOption aac_enc_options[] = {
{ "implicit", "Implicit backwards compatible signaling", 0, AV_OPT_TYPE_CONST, { 0 }, 0, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM, "signaling" }, { "implicit", "Implicit backwards compatible signaling", 0, AV_OPT_TYPE_CONST, { 0 }, 0, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM, "signaling" },
{ "explicit_sbr", "Explicit SBR, implicit PS signaling", 0, AV_OPT_TYPE_CONST, { 1 }, 0, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM, "signaling" }, { "explicit_sbr", "Explicit SBR, implicit PS signaling", 0, AV_OPT_TYPE_CONST, { 1 }, 0, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM, "signaling" },
{ "explicit_hierarchical", "Explicit hierarchical signaling", 0, AV_OPT_TYPE_CONST, { 2 }, 0, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM, "signaling" }, { "explicit_hierarchical", "Explicit hierarchical signaling", 0, AV_OPT_TYPE_CONST, { 2 }, 0, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM, "signaling" },
{ "latm", "Output LATM/LOAS encapsulated data", offsetof(AACContext, latm), AV_OPT_TYPE_INT, { 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
{ "header_period", "StreamMuxConfig and PCE repetition period (in frames)", offsetof(AACContext, header_period), AV_OPT_TYPE_INT, { 0 }, 0, 0xffff, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
{ NULL } { NULL }
}; };
@ -204,12 +208,21 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
/* Choose bitstream format - if global header is requested, use /* Choose bitstream format - if global header is requested, use
* raw access units, otherwise use ADTS. */ * raw access units, otherwise use ADTS. */
if ((err = aacEncoder_SetParam(s->handle, AACENC_TRANSMUX, if ((err = aacEncoder_SetParam(s->handle, AACENC_TRANSMUX,
avctx->flags & CODEC_FLAG_GLOBAL_HEADER ? 0 : 2)) != AACENC_OK) { avctx->flags & CODEC_FLAG_GLOBAL_HEADER ? 0 : s->latm ? 10 : 2)) != AACENC_OK) {
av_log(avctx, AV_LOG_ERROR, "Unable to set the transmux format: %s\n", av_log(avctx, AV_LOG_ERROR, "Unable to set the transmux format: %s\n",
aac_get_error(err)); aac_get_error(err));
goto error; goto error;
} }
if (s->latm && s->header_period) {
if ((err = aacEncoder_SetParam(s->handle, AACENC_HEADER_PERIOD,
s->header_period)) != AACENC_OK) {
av_log(avctx, AV_LOG_ERROR, "Unable to set header period: %s\n",
aac_get_error(err));
goto error;
}
}
/* If no signaling mode is chosen, use explicit hierarchical signaling /* If no signaling mode is chosen, use explicit hierarchical signaling
* if using mp4 mode (raw access units, with global header) and * if using mp4 mode (raw access units, with global header) and
* implicit signaling if using ADTS. */ * implicit signaling if using ADTS. */

View File

@ -28,7 +28,7 @@
#define LIBAVCODEC_VERSION_MAJOR 54 #define LIBAVCODEC_VERSION_MAJOR 54
#define LIBAVCODEC_VERSION_MINOR 44 #define LIBAVCODEC_VERSION_MINOR 44
#define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \ LIBAVCODEC_VERSION_MINOR, \

View File

@ -90,6 +90,7 @@ typedef struct RTMPContext {
char* tcurl; ///< url of the target stream char* tcurl; ///< url of the target stream
char* flashver; ///< version of the flash plugin char* flashver; ///< version of the flash plugin
char* swfurl; ///< url of the swf player char* swfurl; ///< url of the swf player
char* pageurl; ///< url of the web page
int server_bw; ///< server bandwidth int server_bw; ///< server bandwidth
int client_buffer_time; ///< client buffer time in ms int client_buffer_time; ///< client buffer time in ms
int flush_interval; ///< number of packets flushed in the same request (RTMPT only) int flush_interval; ///< number of packets flushed in the same request (RTMPT only)
@ -232,6 +233,11 @@ static int gen_connect(URLContext *s, RTMPContext *rt)
ff_amf_write_number(&p, 252.0); ff_amf_write_number(&p, 252.0);
ff_amf_write_field_name(&p, "videoFunction"); ff_amf_write_field_name(&p, "videoFunction");
ff_amf_write_number(&p, 1.0); ff_amf_write_number(&p, 1.0);
if (rt->pageurl) {
ff_amf_write_field_name(&p, "pageUrl");
ff_amf_write_string(&p, rt->pageurl);
}
} }
ff_amf_write_object_end(&p); ff_amf_write_object_end(&p);
@ -1498,9 +1504,10 @@ static const AVOption rtmp_options[] = {
{"any", "both", 0, AV_OPT_TYPE_CONST, {-2}, 0, 0, DEC, "rtmp_live"}, {"any", "both", 0, AV_OPT_TYPE_CONST, {-2}, 0, 0, DEC, "rtmp_live"},
{"live", "live stream", 0, AV_OPT_TYPE_CONST, {-1}, 0, 0, DEC, "rtmp_live"}, {"live", "live stream", 0, AV_OPT_TYPE_CONST, {-1}, 0, 0, DEC, "rtmp_live"},
{"recorded", "recorded stream", 0, AV_OPT_TYPE_CONST, {0}, 0, 0, DEC, "rtmp_live"}, {"recorded", "recorded stream", 0, AV_OPT_TYPE_CONST, {0}, 0, 0, DEC, "rtmp_live"},
{"rtmp_pageurl", "URL of the web page in which the media was embedded. By default no value will be sent.", OFFSET(pageurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC},
{"rtmp_playpath", "Stream identifier to play or to publish", OFFSET(playpath), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC}, {"rtmp_playpath", "Stream identifier to play or to publish", OFFSET(playpath), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
{"rtmp_swfurl", "URL of the SWF player. By default no value will be sent", OFFSET(swfurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC}, {"rtmp_swfurl", "URL of the SWF player. By default no value will be sent", OFFSET(swfurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
{"rtmp_tcurl", "URL of the target stream. Defaults to rtmp://host[:port]/app.", OFFSET(tcurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC}, {"rtmp_tcurl", "URL of the target stream. Defaults to proto://host[:port]/app.", OFFSET(tcurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
{ NULL }, { NULL },
}; };

View File

@ -170,8 +170,12 @@ static int sctp_open(URLContext *h, const char *uri, int flags)
av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname), av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname),
&port, path, sizeof(path), uri); &port, path, sizeof(path), uri);
if (strcmp(proto,"sctp") || port <= 0 || port >= 65536) if (strcmp(proto, "sctp"))
return AVERROR(EINVAL); return AVERROR(EINVAL);
if (port <= 0 || port >= 65536) {
av_log(s, AV_LOG_ERROR, "Port missing in uri\n");
return AVERROR(EINVAL);
}
s->max_streams = 0; s->max_streams = 0;
p = strchr(uri, '?'); p = strchr(uri, '?');

View File

@ -49,9 +49,12 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname), av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname),
&port, path, sizeof(path), uri); &port, path, sizeof(path), uri);
if (strcmp(proto,"tcp") || port <= 0 || port >= 65536) if (strcmp(proto, "tcp"))
return AVERROR(EINVAL); return AVERROR(EINVAL);
if (port <= 0 || port >= 65536) {
av_log(h, AV_LOG_ERROR, "Port missing in uri\n");
return AVERROR(EINVAL);
}
p = strchr(uri, '?'); p = strchr(uri, '?');
if (p) { if (p) {
if (av_find_info_tag(buf, sizeof(buf), "listen", p)) if (av_find_info_tag(buf, sizeof(buf), "listen", p))