webOS Userland
Native system APIs for webOS
Loading...
Searching...
No Matches
custompipeline.hpp
1
#pragma once
2
3
#include <player-factory/common.hpp>
4
#include <player-factory/pipeline.hpp>
5
6
#include <array>
7
#include <cstddef>
8
#include <cstdint>
9
#include <cstring>
10
11
namespace
mediapipeline {
12
13
struct
PipelineGStreamerElements
14
{
15
void
* pipeline;
16
void
* videoSrc;
17
uint32_t videoBufferSettings[4];
18
void
* audioSrc;
19
uint32_t audioBufferSettings[4];
20
void
* videoQueue;
21
void
* videoDecoder;
22
void
* videoParse;
23
void
* videoSink;
24
void
* videoSinkQueue;
25
void
* audioQueue;
26
void
* audioDecoder;
27
void
* audioReformatter;
28
void
* audioParse;
29
void
* audioSink;
30
void
* audioSinkQueue;
31
void
* audioResampler;
32
void
* audioConverter;
33
};
34
35
class
CustomPipeline
:
public
Pipeline
{
36
public
:
37
inline
PipelineGStreamerElements
* GetGStreamerElements(
const
std::array<uint32_t, 4>& target,
38
const
int
searchOffset = 2048)
39
{
40
const
auto
memory =
reinterpret_cast<
uint8_t*
>
(
this
);
41
42
for
(
int
i = 0; i < searchOffset; ++i)
43
{
44
if
(std::memcmp(memory + i, target.data(),
sizeof
(uint32_t) * 4) == 0)
45
{
46
return
reinterpret_cast<
PipelineGStreamerElements
*
>
(
47
memory + i - offsetof(
PipelineGStreamerElements
, videoBufferSettings));
48
}
49
}
50
51
return
nullptr
;
52
}
53
54
bool
loadSpi_getInfo(
MEDIA_CUSTOM_CONTENT_INFO_T
* contentInfo);
55
void
sendSegmentEvent();
56
void
setContentInfo(MEDIA_CUSTOM_SRC_TYPE_T srcType,
MEDIA_CUSTOM_CONTENT_INFO_T
* contentInfo);
57
};
58
59
}
mediapipeline::CustomPipeline
Definition
custompipeline.hpp:35
mediapipeline::Pipeline
Definition
pipeline.hpp:5
MEDIA_CUSTOM_CONTENT_INFO_T
Definition
common.hpp:9
mediapipeline::PipelineGStreamerElements
Definition
custompipeline.hpp:14
include
player-factory
custompipeline.hpp
Generated by
1.9.8