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
js
mse
source_buffer.h
Go to the documentation of this file.
1
// Copyright 2016 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_JS_MSE_SOURCE_BUFFER_H_
16
#define SHAKA_EMBEDDED_JS_MSE_SOURCE_BUFFER_H_
17
18
#include <string>
19
20
#include "
shaka/media/demuxer.h
"
21
#include "
shaka/media/media_player.h
"
22
#include "
shaka/media/streams.h
"
23
#include "
src/core/member.h
"
24
#include "
src/js/events/event_target.h
"
25
#include "
src/mapping/byte_buffer.h
"
26
#include "
src/mapping/enum.h
"
27
#include "
src/mapping/exception_or.h
"
28
#include "
src/media/demuxer_thread.h
"
29
#include "
src/media/types.h
"
30
31
namespace
shaka
{
32
namespace
js {
33
namespace
mse {
34
class
MediaSource
;
35
class
TimeRanges;
36
37
38
enum class
AppendMode
{
39
SEGMENTS
,
40
SEQUENCE
,
41
};
42
43
class
SourceBuffer
:
public
events::EventTarget
{
44
DECLARE_TYPE_INFO
(
SourceBuffer
);
45
46
public
:
47
SourceBuffer
(
const
std::string& mime,
RefPtr<MediaSource>
media_source);
48
49
void
Trace(
memory::HeapTracer
* tracer)
const override
;
50
51
bool
Attach(
const
std::string& mime,
media::MediaPlayer
* player,
52
bool
is_video);
53
void
Detach();
54
55
ExceptionOr<void>
AppendBuffer(
ByteBuffer
data);
56
void
Abort();
57
ExceptionOr<void>
Remove(
double
start,
double
end);
58
59
media::BufferedRanges
GetBufferedRanges()
const
;
60
ExceptionOr<RefPtr<TimeRanges>
> GetBuffered()
const
;
61
62
double
TimestampOffset()
const
;
63
ExceptionOr<void>
SetTimestampOffset(
double
offset);
64
double
AppendWindowStart()
const
;
65
ExceptionOr<void>
SetAppendWindowStart(
double
window_start);
66
double
AppendWindowEnd()
const
;
67
ExceptionOr<void>
SetAppendWindowEnd(
double
window_end);
68
69
AppendMode
mode
;
70
bool
updating
;
71
72
Listener
on_update_start
;
73
Listener
on_update
;
74
Listener
on_update_end
;
75
Listener
on_error
;
76
Listener
on_abort
;
77
78
private
:
80
void
OnAppendComplete(
bool
success);
81
82
media::ElementaryStream
frames_;
83
media::DemuxerThread
demuxer_;
84
85
Member<MediaSource>
media_source_;
86
ByteBuffer
append_buffer_;
87
double
timestamp_offset_;
88
double
append_window_start_;
89
double
append_window_end_;
90
};
91
92
class
SourceBufferFactory
93
:
public
BackingObjectFactory
<SourceBuffer, events::EventTarget> {
94
public
:
95
SourceBufferFactory
();
96
};
97
98
}
// namespace mse
99
}
// namespace js
100
}
// namespace shaka
101
102
DEFINE_ENUM_MAPPING
(
shaka::js::mse
,
AppendMode
) {
103
AddMapping(
Enum::SEGMENTS
,
"segments"
);
104
AddMapping(
Enum::SEQUENCE
,
"sequence"
);
105
}
106
107
#endif // SHAKA_EMBEDDED_JS_MSE_SOURCE_BUFFER_H_
shaka::ExceptionOr
Definition:
exception_or.h:36
types.h
shaka::media::DemuxerThread
Definition:
demuxer_thread.h:41
shaka::js::mse::SourceBuffer::on_update_end
Listener on_update_end
Definition:
source_buffer.h:74
streams.h
byte_buffer.h
shaka::js::mse::SourceBuffer::on_error
Listener on_error
Definition:
source_buffer.h:75
shaka::ByteBuffer
Definition:
byte_buffer.h:33
shaka::Member
Definition:
member.h:40
media_player.h
shaka::js::mse
Definition:
media_element.cc:30
demuxer.h
shaka::media::Stream
Definition:
streams.h:182
shaka::BackingObjectFactory
Definition:
backing_object_factory.h:406
shaka
Definition:
async_results.h:25
shaka::js::mse::AppendMode::SEQUENCE
shaka::js::mse::AppendMode::SEGMENTS
exception_or.h
enum.h
shaka::memory::HeapTracer
Definition:
heap_tracer.h:85
shaka::js::mse::SourceBuffer::on_update_start
Listener on_update_start
Definition:
source_buffer.h:72
shaka::js::mse::SourceBuffer::on_update
Listener on_update
Definition:
source_buffer.h:73
shaka::ExceptionOr< void >
Definition:
exception_or.h:41
shaka::js::mse::AppendMode
AppendMode
Definition:
source_buffer.h:38
shaka::js::mse::SourceBuffer::mode
AppendMode mode
Definition:
source_buffer.h:69
member.h
shaka::RefPtr
Definition:
ref_ptr.h:43
shaka::media::BufferedRanges
std::vector< BufferedRange > BufferedRanges
Definition:
types.h:26
demuxer_thread.h
shaka::media::MediaPlayer
Definition:
media_player.h:184
DEFINE_ENUM_MAPPING
DEFINE_ENUM_MAPPING(shaka::js::mse, AppendMode)
Definition:
source_buffer.h:102
shaka::js::mse::SourceBuffer::on_abort
Listener on_abort
Definition:
source_buffer.h:76
shaka::js::mse::SourceBuffer::updating
bool updating
Definition:
source_buffer.h:70
shaka::js::mse::SourceBufferFactory
Definition:
source_buffer.h:92
shaka::js::events::EventTarget
Definition:
event_target.h:40
event_target.h
DECLARE_TYPE_INFO
#define DECLARE_TYPE_INFO(type)
Definition:
backing_object.h:39
shaka::js::mse::SourceBuffer
Definition:
source_buffer.h:43
shaka::media::MediaDecodingType::MediaSource
Generated by
1.8.13