forked from wang-bin/QtAV
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ffmpeg: user new format iterate api if possible
- Loading branch information
Showing
5 changed files
with
54 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/****************************************************************************** | ||
QtAV: Multimedia framework based on Qt and FFmpeg | ||
Copyright (C) 2012-2016 Wang Bin <[email protected]> | ||
Copyright (C) 2012-2018 Wang Bin <[email protected]> | ||
* This file is part of QtAV (from 2015) | ||
|
@@ -51,7 +51,9 @@ class AVMuxer::Private | |
, aenc(0) | ||
, venc(0) | ||
{ | ||
#if !AVFORMAT_STATIC_REGISTER | ||
av_register_all(); | ||
#endif | ||
} | ||
~Private() { | ||
//delete interrupt_hanlder; | ||
|
@@ -186,10 +188,15 @@ static void getFFmpegOutputFormats(QStringList* formats, QStringList* extensions | |
static QStringList exts; | ||
static QStringList fmts; | ||
if (exts.isEmpty() && fmts.isEmpty()) { | ||
av_register_all(); // MUST register all input/output formats | ||
AVOutputFormat *o = NULL; | ||
QStringList e, f; | ||
const AVOutputFormat *o = NULL; | ||
#if AVFORMAT_STATIC_REGISTER | ||
void* it = NULL; | ||
while ((o = av_muxer_iterate(&it))) { | ||
#else | ||
av_register_all(); // MUST register all input/output formats | ||
while ((o = av_oformat_next(o))) { | ||
#endif | ||
if (o->extensions) | ||
e << QString::fromLatin1(o->extensions).split(QLatin1Char(','), QString::SkipEmptyParts); | ||
if (o->name) | ||
|
@@ -239,7 +246,9 @@ const QStringList &AVMuxer::supportedProtocols() | |
#if QTAV_HAVE(AVDEVICE) | ||
protocols << QStringLiteral("avdevice"); | ||
#endif | ||
#if !AVFORMAT_STATIC_REGISTER | ||
av_register_all(); // MUST register all input/output formats | ||
#endif | ||
void* opq = 0; | ||
const char* protocol = avio_enum_protocols(&opq, 1); | ||
while (protocol) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters