Shaka Player Embedded
Main Page
Exported Types
+
Tutorials
Basic Tutorial
Network Filters
Internal Docs
+
Internal Class List
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
~
+
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
~
+
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Typedefs
a
b
d
e
f
h
i
l
m
r
s
t
v
Enumerations
+
Enumerator
a
b
c
d
e
k
n
p
t
v
+
Properties
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
v
w
+
Related Functions
:
a
c
d
g
j
m
o
p
r
s
v
w
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
shaka
src
media
decoder_thread.h
Go to the documentation of this file.
1
// Copyright 2017 Google LLC
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// https://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#ifndef SHAKA_EMBEDDED_MEDIA_DECODER_THREAD_H_
16
#define SHAKA_EMBEDDED_MEDIA_DECODER_THREAD_H_
17
18
#include <string>
19
20
#include "
shaka/media/decoder.h
"
21
#include "
shaka/media/streams.h
"
22
#include "
src/debug/mutex.h
"
23
#include "
src/debug/thread.h
"
24
#include "
src/debug/thread_event.h
"
25
#include "
src/util/macros.h
"
26
27
namespace
shaka
{
28
29
namespace
eme {
30
class
Implementation;
31
}
// namespace eme
32
33
namespace
media {
34
39
class
DecoderThread
{
40
public
:
41
class
Client
{
42
public
:
43
virtual
~Client
() {}
44
45
// These should have the same names as MediaPlayer to ensure we can subclass
46
// both.
47
virtual
double
CurrentTime()
const
= 0;
48
virtual
double
Duration()
const
= 0;
49
virtual
void
OnWaitingForKey() = 0;
50
51
virtual
void
OnError(
const
std::string& error) = 0;
52
};
53
58
DecoderThread
(
Client
* client,
DecodedStream
* output);
59
~
DecoderThread
();
60
61
SHAKA_NON_COPYABLE_OR_MOVABLE_TYPE
(
DecoderThread
);
62
64
void
Attach(
const
ElementaryStream
* input);
65
67
void
Detach();
68
73
void
OnSeek();
74
75
void
SetCdm(
eme::Implementation
* cdm);
76
78
void
SetDecoder(
Decoder
* decoder);
79
80
private
:
81
void
ThreadMain();
82
83
Mutex
mutex_;
84
ThreadEvent<void>
signal_;
85
86
Client
*
const
client_;
87
const
ElementaryStream
* input_;
88
DecodedStream
*
const
output_;
89
Decoder
* decoder_;
90
91
eme::Implementation
* cdm_;
92
double
last_frame_time_;
93
bool
shutdown_;
94
bool
did_flush_;
95
bool
raised_waiting_event_;
96
97
Thread
thread_;
98
};
99
100
}
// namespace media
101
}
// namespace shaka
102
103
#endif // SHAKA_EMBEDDED_MEDIA_DECODER_THREAD_H_
macros.h
streams.h
shaka::media::DecoderThread
Definition:
decoder_thread.h:39
shaka::Thread
Definition:
thread.h:24
SHAKA_NON_COPYABLE_OR_MOVABLE_TYPE
#define SHAKA_NON_COPYABLE_OR_MOVABLE_TYPE(Type)
Definition:
macros.h:51
shaka::media::Stream< DecodedFrame, false >
shaka
Definition:
async_results.h:25
shaka::Mutex
Definition:
mutex.h:155
thread.h
shaka::media::Decoder
Definition:
decoder.h:42
shaka::eme::Implementation
Definition:
implementation.h:86
shaka::ThreadEvent< void >
shaka::media::DecoderThread::Client
Definition:
decoder_thread.h:41
mutex.h
decoder.h
shaka::media::DecoderThread::Client::~Client
virtual ~Client()
Definition:
decoder_thread.h:43
thread_event.h
Generated by
1.8.13