-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathNoovoPlayerDriver.h
64 lines (45 loc) · 1.14 KB
/
NoovoPlayerDriver.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* Copyright 2017-2018 Noovo Crop.
* This software it the property of Noovo Crop.
* You have to accept the terms in the license file before use
*
* Created by JohnChang 2017-06-12
*
* Copyright (c) 2017-2018 Noovo Crop. All rights reserved
*/
#ifndef NOOVO_MEDIA_SERVER_DRIVER_H_
#define NOOVO_MEDIA_SERVER_DRIVER_H_
#include "ALooper.h"
#include "common.h"
#include "NoovoPlayer.h"
namespace android {
struct NoovoMediaServerDriver : RefBase{
NoovoMediaServerDriver();
protected:
~NoovoMediaServerDriver();
private:
sp<ALooper> mLooper;
sp<NoovoMediaServer> mPlayer;
enum State {
UNINITIALIZED,
STOPPED,
SCANNING,
RECORDING,
PAUSED
};
};
NoovoMediaServerDriver::NoovoMediaServerDriver()
: mLooper(new ALooper)
{
mLooper->setName("NoovoMediaServerDriver Looper");
mLooper->start(
false, /* runOnCallingThread */
false, /* canCallJava */
PRIORITY_AUDIO);
mPlayer = new NoovoMediaServer;
mLooper->registerHandler(mPlayer);
}
NoovoMediaServerDriver::~NoovoMediaServerDriver() {
mLooper->stop();
}
}
#endif