forked from mia/Aegisub
s/Video/FFmpegSourceVideoProvider/, originally I was planning something different now we're moving all media-related code, also add missing GetDecoderName() method which was somehow removed by accident in a previous revision.
Originally committed to SVN as r5328.
This commit is contained in:
parent
83fd95c605
commit
7d2594b134
2 changed files with 9 additions and 8 deletions
|
@ -49,7 +49,7 @@ namespace media {
|
|||
|
||||
/// @brief Constructor
|
||||
/// @param filename The filename to open
|
||||
Video::Video(std::string filename)
|
||||
FFmpegSourceVideoProvider::FFmpegSourceVideoProvider(std::string filename)
|
||||
: VideoSource(NULL)
|
||||
, VideoInfo(NULL)
|
||||
, Width(-1)
|
||||
|
@ -95,14 +95,14 @@ Video::Video(std::string filename)
|
|||
|
||||
|
||||
/// @brief Destructor
|
||||
Video::~Video() {
|
||||
FFmpegSourceVideoProvider::~FFmpegSourceVideoProvider() {
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
/// @brief Opens video
|
||||
/// @param filename The filename to open
|
||||
void Video::LoadVideo(std::string filename) {
|
||||
void FFmpegSourceVideoProvider::LoadVideo(std::string filename) {
|
||||
|
||||
FFMS_Indexer *Indexer = FFMS_CreateIndexer(filename.c_str(), &ErrInfo);
|
||||
if (Indexer == NULL) {
|
||||
|
@ -252,7 +252,7 @@ void Video::LoadVideo(std::string filename) {
|
|||
|
||||
/// @brief Close video
|
||||
///
|
||||
void Video::Close() {
|
||||
void FFmpegSourceVideoProvider::Close() {
|
||||
if (VideoSource) FFMS_DestroyVideoSource(VideoSource);
|
||||
#ifdef WIN32
|
||||
if (COMInited)
|
||||
|
@ -264,7 +264,7 @@ void Video::Close() {
|
|||
/// @param _n
|
||||
/// @return
|
||||
///
|
||||
const media::AegiVideoFrame Video::GetFrame(int n) {
|
||||
const media::AegiVideoFrame FFmpegSourceVideoProvider::GetFrame(int n) {
|
||||
FrameNumber = agi::util::mid(0, n, GetFrameCount() - 1);
|
||||
|
||||
// decode frame
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace media {
|
|||
|
||||
/// @class FFmpegSourceVideoProvider
|
||||
/// @brief Implements video loading through the FFMS library.
|
||||
class Video : public VideoProvider, FFmpegSourceProvider {
|
||||
class FFmpegSourceVideoProvider : public VideoProvider, FFmpegSourceProvider {
|
||||
private:
|
||||
FFMS_VideoSource *VideoSource; /// video source object
|
||||
const FFMS_VideoProperties *VideoInfo; /// video properties
|
||||
|
@ -55,8 +55,8 @@ private:
|
|||
void Close();
|
||||
|
||||
public:
|
||||
Video(std::string filename);
|
||||
~Video();
|
||||
FFmpegSourceVideoProvider(std::string filename);
|
||||
~FFmpegSourceVideoProvider();
|
||||
|
||||
const media::AegiVideoFrame GetFrame(int n);
|
||||
|
||||
|
@ -69,6 +69,7 @@ public:
|
|||
/// @brief Gets a list of keyframes
|
||||
/// @return Returns a vector<int> of keyframes.
|
||||
std::vector<int> GetKeyFrames() const { return KeyFramesList; };
|
||||
std::string GetDecoderName() const { return "FFmpegSource"; }
|
||||
/// @brief Gets the desired cache behavior.
|
||||
/// @return Returns true.
|
||||
bool WantsCaching() const { return true; }
|
||||
|
|
Loading…
Reference in a new issue