summaryrefslogtreecommitdiff
path: root/src/lib/cpu_player_video_preparer.h
blob: 7cb46dc104c493139e2164adb063f22a92247f31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef DCPOMATIC_CPU_PLAYER_VIDEO_PREPARER_H
#define DCPOMATIC_CPU_PLAYER_VIDEO_PREPARER_H

#include "player_video_preparer.h"
extern "C" {
#include <libavutil/pixfmt.h>
}
#include <boost/asio.hpp>
#include <boost/thread.hpp>
#include <boost/weak_ptr.hpp>


class CPUPlayerVideoPreparer : public PlayerVideoPreparer
{
public:
	CPUPlayerVideoPreparer (boost::function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast);
	~CPUPlayerVideoPreparer ();

	void request (boost::shared_ptr<PlayerVideo> pv);

private:
	void prepare (boost::weak_ptr<PlayerVideo> pv);

	boost::thread_group _pool;
	boost::asio::io_service _service;
	boost::shared_ptr<boost::asio::io_service::work> _work;

	boost::function<AVPixelFormat (AVPixelFormat)> _pixel_format;
	bool _aligned;
	bool _fast;
};

#endif