forked from mia/Aegisub
Compilation fixes now that ffmpegsource_common.cpp has been moved over. Everything compiles correctly now.
Originally committed to SVN as r5279.
This commit is contained in:
parent
b47dd1e220
commit
ffff58d698
4 changed files with 17 additions and 7 deletions
|
@ -25,6 +25,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "ffms_audio.h"
|
#include "ffms_audio.h"
|
||||||
|
#include "libaegisub/media.h"
|
||||||
|
|
||||||
namespace agi {
|
namespace agi {
|
||||||
namespace ffms {
|
namespace ffms {
|
||||||
|
@ -161,9 +162,9 @@ void Audio::LoadAudio(std::string filename) {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
#if FFMS_VERSION >= ((2 << 24) | (14 << 16) | (1 << 8) | 0)
|
#if FFMS_VERSION >= ((2 << 24) | (14 << 16) | (1 << 8) | 0)
|
||||||
AudioSource = FFMS_CreateAudioSource(FileNameShort.utf8_str(), TrackNumber, Index, -1, &ErrInfo);
|
AudioSource = FFMS_CreateAudioSource(filename.c_str(), TrackNumber, Index, -1, &ErrInfo);
|
||||||
#else
|
#else
|
||||||
AudioSource = FFMS_CreateAudioSource(FileNameShort.utf8_str(), TrackNumber, Index, &ErrInfo);
|
AudioSource = FFMS_CreateAudioSource(filename.c_str(), TrackNumber, Index, &ErrInfo);
|
||||||
#endif
|
#endif
|
||||||
FFMS_DestroyIndex(Index);
|
FFMS_DestroyIndex(Index);
|
||||||
Index = NULL;
|
Index = NULL;
|
||||||
|
@ -197,9 +198,9 @@ Audio::~Audio() {
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Clean up
|
/// @brief Clean up
|
||||||
///
|
///
|
||||||
void FFmpegSourceAudioProvider::Close() {
|
void Audio::Close() {
|
||||||
if (AudioSource) FFMS_DestroyAudioSource(AudioSource);
|
if (AudioSource) FFMS_DestroyAudioSource(AudioSource);
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
if (COMInited)
|
if (COMInited)
|
||||||
|
|
|
@ -29,12 +29,14 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "ffms_common.h"
|
||||||
|
|
||||||
namespace agi {
|
namespace agi {
|
||||||
namespace ffms {
|
namespace ffms {
|
||||||
|
|
||||||
/// @class Audio
|
/// @class Audio
|
||||||
/// Audio file support.
|
/// Audio file support.
|
||||||
class Audio {
|
class Audio : public FFmpegSourceProvider {
|
||||||
FFMS_AudioSource *AudioSource; ///< audio source object
|
FFMS_AudioSource *AudioSource; ///< audio source object
|
||||||
bool COMInited; ///< COM initialization state
|
bool COMInited; ///< COM initialization state
|
||||||
|
|
||||||
|
@ -44,6 +46,11 @@ class Audio {
|
||||||
void Close();
|
void Close();
|
||||||
void LoadAudio(std::string filename);
|
void LoadAudio(std::string filename);
|
||||||
|
|
||||||
|
int channels;
|
||||||
|
int64_t num_samples; // for one channel, ie. number of PCM frames
|
||||||
|
int sample_rate;
|
||||||
|
int bytes_per_sample;
|
||||||
|
|
||||||
Audio(std::string filename);
|
Audio(std::string filename);
|
||||||
virtual ~Audio();
|
virtual ~Audio();
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
|
|
||||||
#include "ffms_video.h"
|
#include "ffms_video.h"
|
||||||
#include "libaegisub/media.h"
|
#include "libaegisub/media.h"
|
||||||
|
#include "libaegisub/util.h"
|
||||||
|
|
||||||
//#include "aegisub_endian.h"
|
//#include "aegisub_endian.h"
|
||||||
//#include "compat.h"
|
//#include "compat.h"
|
||||||
|
@ -265,7 +266,7 @@ void Video::Close() {
|
||||||
/// @return
|
/// @return
|
||||||
///
|
///
|
||||||
const media::AegiVideoFrame Video::GetFrame(int n) {
|
const media::AegiVideoFrame Video::GetFrame(int n) {
|
||||||
FrameNumber = mid(0, n, GetFrameCount() - 1);
|
FrameNumber = util::mid(0, n, GetFrameCount() - 1);
|
||||||
|
|
||||||
// decode frame
|
// decode frame
|
||||||
const FFMS_Frame *SrcFrame = FFMS_GetFrame(VideoSource, FrameNumber, &ErrInfo);
|
const FFMS_Frame *SrcFrame = FFMS_GetFrame(VideoSource, FrameNumber, &ErrInfo);
|
||||||
|
|
|
@ -28,13 +28,14 @@
|
||||||
#include "libaegisub/media_video_frame.h"
|
#include "libaegisub/media_video_frame.h"
|
||||||
#include "libaegisub/vfr.h"
|
#include "libaegisub/vfr.h"
|
||||||
#include "libaegisub/exception.h"
|
#include "libaegisub/exception.h"
|
||||||
|
#include "ffms_common.h"
|
||||||
|
|
||||||
namespace agi {
|
namespace agi {
|
||||||
namespace ffms {
|
namespace ffms {
|
||||||
|
|
||||||
/// @class FFmpegSourceVideoProvider
|
/// @class FFmpegSourceVideoProvider
|
||||||
/// @brief Implements video loading through the FFMS library.
|
/// @brief Implements video loading through the FFMS library.
|
||||||
class Video {
|
class Video : public FFmpegSourceProvider {
|
||||||
private:
|
private:
|
||||||
FFMS_VideoSource *VideoSource; /// video source object
|
FFMS_VideoSource *VideoSource; /// video source object
|
||||||
const FFMS_VideoProperties *VideoInfo; /// video properties
|
const FFMS_VideoProperties *VideoInfo; /// video properties
|
||||||
|
|
Loading…
Reference in a new issue