mirror of
https://github.com/wang-bin/QtAV.git
synced 2026-10-29 03:26:39 +08:00
fix build error etc.
This commit is contained in:
@@ -83,13 +83,13 @@ public:
|
||||
Q_SIGNALS:
|
||||
void error(const QtAV::AVError& e); //explictly use QtAV::AVError in connection for Qt4 syntax
|
||||
void descriptionChanged();
|
||||
virtual void codecNameChanged();
|
||||
protected:
|
||||
AVDecoder(AVDecoderPrivate& d);
|
||||
DPTR_DECLARE(AVDecoder)
|
||||
// force a codec. only used by avcodec sw decoders
|
||||
void setCodecName(const QString& name);
|
||||
QString codecName() const;
|
||||
virtual void codecNameChanged() {}
|
||||
private:
|
||||
Q_DISABLE_COPY(AVDecoder)
|
||||
AVDecoder(); // base class, not direct create. only final class has is enough
|
||||
|
||||
@@ -85,7 +85,8 @@ public:
|
||||
void setCaptureDir(const QString& value);
|
||||
QString captureDir() const;
|
||||
public Q_SLOTS:
|
||||
void request();
|
||||
void capture();
|
||||
QTAV_DEPRECATED void request();
|
||||
Q_SIGNALS:
|
||||
void requested();
|
||||
/*use it to popup a dialog for selecting dir, name etc. TODO: block avthread if not async*/
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <QtAV/VideoFrame.h>
|
||||
|
||||
class QSize;
|
||||
struct SwsContext;
|
||||
namespace QtAV {
|
||||
|
||||
typedef int VideoDecoderId;
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QMutex>
|
||||
#include <QtCore/QThread>
|
||||
#include "QtAV/private/AVCompat.h"
|
||||
|
||||
namespace QtAV {
|
||||
@@ -55,7 +53,6 @@ public:
|
||||
bool available; //TODO: true only when context(and hw ctx) is ready
|
||||
bool is_open;
|
||||
int undecoded_size;
|
||||
QMutex mutex;
|
||||
QString codec_name;
|
||||
QVariantHash options;
|
||||
AVDictionary *dict;
|
||||
|
||||
+7
-11
@@ -29,15 +29,7 @@ namespace QtAV {
|
||||
AVDecoder::AVDecoder(AVDecoderPrivate &d)
|
||||
:DPTR_INIT(&d)
|
||||
{
|
||||
class AVInitializer {
|
||||
public:
|
||||
AVInitializer() {
|
||||
qDebug("avcodec_register_all");
|
||||
avcodec_register_all();
|
||||
}
|
||||
};
|
||||
static AVInitializer sAVInit;
|
||||
Q_UNUSED(sAVInit);
|
||||
avcodec_register_all(); // avcodec_find_decoder will always be used
|
||||
}
|
||||
|
||||
AVDecoder::~AVDecoder()
|
||||
@@ -165,7 +157,11 @@ AVCodecContext* AVDecoder::codecContext() const
|
||||
|
||||
void AVDecoder::setCodecName(const QString &name)
|
||||
{
|
||||
d_func().codec_name = name;
|
||||
DPTR_D(AVDecoder);
|
||||
if (d.codec_name == name)
|
||||
return;
|
||||
d.codec_name = name;
|
||||
Q_EMIT codecNameChanged();
|
||||
}
|
||||
|
||||
QString AVDecoder::codecName() const
|
||||
@@ -224,7 +220,7 @@ void AVDecoder::setOptions(const QVariantHash &dict)
|
||||
else if (dict.contains(name().toLower()))
|
||||
opt = dict.value(name().toLower());
|
||||
else
|
||||
return;
|
||||
return; // TODO: set property if no name() key found?
|
||||
if (opt.type() == QVariant::Hash) {
|
||||
QVariantHash property_dict(opt.toHash());
|
||||
if (property_dict.isEmpty())
|
||||
|
||||
@@ -66,7 +66,9 @@ public:
|
||||
AudioDecoderFFmpegPrivate()
|
||||
: AudioDecoderPrivate()
|
||||
, frame(av_frame_alloc())
|
||||
{}
|
||||
{
|
||||
avcodec_register_all();
|
||||
}
|
||||
~AudioDecoderFFmpegPrivate() {
|
||||
if (frame) {
|
||||
av_frame_free(&frame);
|
||||
|
||||
@@ -49,6 +49,7 @@ public:
|
||||
: VideoDecoderPrivate()
|
||||
, frame(0)
|
||||
{
|
||||
avcodec_register_all();
|
||||
frame = av_frame_alloc();
|
||||
}
|
||||
virtual ~VideoDecoderFFmpegBasePrivate() {
|
||||
|
||||
Reference in New Issue
Block a user