libeplayer3: implement Playback and Input classes

This commit is contained in:
martii
2014-04-07 21:01:02 +02:00
parent 6c1f7c13bd
commit cba7a708be
12 changed files with 707 additions and 1191 deletions

View File

@@ -1,25 +1,63 @@
#ifndef COMMON_H_
#define COMMON_H_
#ifndef __PLAYER_H__
#define __PLAYER_H__
#include <OpenThreads/ScopedLock>
#include <OpenThreads/Thread>
#include <OpenThreads/Condition>
extern "C" {
#include <libavutil/avutil.h>
#include <libavutil/time.h>
#include <libavformat/avformat.h>
#include <libswresample/swresample.h>
#include <libavutil/opt.h>
}
#include "container.h"
#include "output.h"
#include "manager.h"
#include "playback.h"
#include <pthread.h>
#include <stdint.h>
class Player {
public: //FIXME
PlaybackHandler_t *playback;
ContainerHandler_t *container;
int64_t *currentAudioPtsP;
public:
Player();
~Player();
#include <string>
#include <vector>
#include <map>
Output output;
Manager manager;
#include "input.h"
#include "output.h"
#include "manager.h"
#include "playback.h"
#include "player.h"
struct Chapter
{
std::string title;
double start;
double end;
};
int container_ffmpeg_update_tracks(Player * context, const char *filename);
class Player {
friend class Input;
friend class Output;
friend class Manager;
friend class Playback;
friend class cPlayback;
private:
Input input;
Output output;
Manager manager;
Playback playback;
OpenThreads::Mutex chapterMutex;
std::vector<Chapter> chapters;
public: //FIXME
int64_t *currentAudioPtsP;
public:
Player()
{
input.context = this;
output.context = this;
playback.context = this;
manager.context = this;
}
bool GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
void SetChapters(std::vector<Chapter> &Chapters);
};
#endif