mirror of https://github.com/odrling/Aegisub
(Maybe) fixed lavc after previous commit.
Originally committed to SVN as r1959.
This commit is contained in:
parent
6b12f54d72
commit
abbab149a6
|
@ -47,10 +47,11 @@ LAVCFile::Initializer::Initializer()
|
||||||
av_register_all();
|
av_register_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
LAVCFile::LAVCFile(wxString filename)
|
LAVCFile::LAVCFile(Aegisub::String _filename)
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
fctx = NULL;
|
fctx = NULL;
|
||||||
|
wxString filename = _filename.c_str();
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
wxFileName fn(filename);
|
wxFileName fn(filename);
|
||||||
|
|
|
@ -44,12 +44,14 @@ extern "C" {
|
||||||
#include <ffmpeg/avcodec.h>
|
#include <ffmpeg/avcodec.h>
|
||||||
#include <ffmpeg/avformat.h>
|
#include <ffmpeg/avformat.h>
|
||||||
}
|
}
|
||||||
|
#include "include/aegisub/aegisub.h"
|
||||||
|
|
||||||
|
|
||||||
class LAVCFile {
|
class LAVCFile {
|
||||||
private:
|
private:
|
||||||
unsigned refs;
|
unsigned refs;
|
||||||
|
|
||||||
LAVCFile(wxString filename);
|
LAVCFile(Aegisub::String filename);
|
||||||
~LAVCFile();
|
~LAVCFile();
|
||||||
|
|
||||||
class Initializer {
|
class Initializer {
|
||||||
|
@ -61,7 +63,7 @@ private:
|
||||||
public:
|
public:
|
||||||
AVFormatContext *fctx;
|
AVFormatContext *fctx;
|
||||||
|
|
||||||
static LAVCFile *Create(wxString filename) { return new LAVCFile(filename); }
|
static LAVCFile *Create(Aegisub::String filename) { return new LAVCFile(filename); }
|
||||||
LAVCFile *AddRef() { refs++; return this; };
|
LAVCFile *AddRef() { refs++; return this; };
|
||||||
void Release() { if (!--refs) delete this; };
|
void Release() { if (!--refs) delete this; };
|
||||||
};
|
};
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
|
|
||||||
///////////////
|
///////////////
|
||||||
// Constructor
|
// Constructor
|
||||||
LAVCVideoProvider::LAVCVideoProvider(wxString filename,double fps) {
|
LAVCVideoProvider::LAVCVideoProvider(Aegisub::String filename,double fps) {
|
||||||
// Init variables
|
// Init variables
|
||||||
codecContext = NULL;
|
codecContext = NULL;
|
||||||
lavcfile = NULL;
|
lavcfile = NULL;
|
||||||
|
@ -86,7 +86,7 @@ LAVCVideoProvider::~LAVCVideoProvider() {
|
||||||
|
|
||||||
//////////////
|
//////////////
|
||||||
// Load video
|
// Load video
|
||||||
void LAVCVideoProvider::LoadVideo(wxString filename, double fps) {
|
void LAVCVideoProvider::LoadVideo(Aegisub::String filename, double fps) {
|
||||||
// Close first
|
// Close first
|
||||||
Close();
|
Close();
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ extern "C" {
|
||||||
#include <ffmpeg/swscale.h>
|
#include <ffmpeg/swscale.h>
|
||||||
}
|
}
|
||||||
#include "include/aegisub/video_provider.h"
|
#include "include/aegisub/video_provider.h"
|
||||||
|
#include "include/aegisub/aegisub.h"
|
||||||
#include "mkv_wrap.h"
|
#include "mkv_wrap.h"
|
||||||
#include "lavc_file.h"
|
#include "lavc_file.h"
|
||||||
|
|
||||||
|
@ -94,7 +95,7 @@ private:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LAVCVideoProvider(wxString filename, double fps);
|
LAVCVideoProvider(Aegisub::String filename, double fps);
|
||||||
~LAVCVideoProvider();
|
~LAVCVideoProvider();
|
||||||
|
|
||||||
const AegiVideoFrame GetFrame(int n,int formatType);
|
const AegiVideoFrame GetFrame(int n,int formatType);
|
||||||
|
@ -104,7 +105,7 @@ public:
|
||||||
int GetWidth();
|
int GetWidth();
|
||||||
int GetHeight();
|
int GetHeight();
|
||||||
double GetFPS();
|
double GetFPS();
|
||||||
wxString GetDecoderName() { return _T("FFMpeg/libavcodec"); }
|
Aegisub::String GetDecoderName() { return L"FFMpeg/libavcodec"; }
|
||||||
bool IsNativelyByFrames() { return true; }
|
bool IsNativelyByFrames() { return true; }
|
||||||
int GetDesiredCacheSize() { return 8; }
|
int GetDesiredCacheSize() { return 8; }
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue