DtvKit_ATSC3.0
Loading...
Searching...
No Matches
atsc_core_streamer_hlsmaker.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3 *
4 * This file is part of a DTVKit Software Component
5 * You are permitted to copy, modify or distribute this file subject to the terms
6 * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
7 *
8 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
9 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
10 * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
11 *
12 * If you or your organisation is not a member of DTVKit then you have access
13 * to this source code outside of the terms of the licence agreement
14 * and you are expected to delete this and any associated files immediately.
15 * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
16 *******************************************************************************/
17
18#ifndef ATSC_CORE_STREAMER_HLSMARKER_H_
19#define ATSC_CORE_STREAMER_HLSMARKER_H_
20
21#pragma once
22#include <stdio.h>
23#include <stdlib.h>
24#include <string.h>
25#include <string>
26#include <queue>
27#include <sys/time.h>
28#include <list>
29
30#include "atsc_core_utils_tinyxml2.h"
32
40typedef struct {
41 uint32_t iSequence;
42 int32_t iMediaType;
43 int32_t iTsi;
44 double dExtinf;
45 std::string sUri;
47
52 int32_t iMediaType;
53 uint32_t iTsi;
54 int32_t iBandwidth;
55 std::string sInitLocation;
56 std::string sMediaLocation;
57 std::string sCodecs;
58 std::string sUri;
66 bool operator<(tMediaMasterPlayListItem sItem){
67 return this->iMediaType >= sItem.iMediaType;
68 }
70
74typedef struct{
75 int32_t iTsi;
76 int32_t iMediaType;
77 std::string sPath;
79
85{
86public:
87
95
103
110 void Init(int32_t iCategory);
111
118 void MakeIndex(std::list<sMediaMasterPlaylistItem_t> list);
119
126 void SetMasterItem(std::list<sMediaMasterPlaylistItem_t> list);
127
134 void SetDefaultProperties(char* mime_type, char* init, char* media);
135
142 void GetInitData(char* pPath, char* pData, int32_t* iDataLen);
143
150 void GetMp4Parameter(char* pVideoPath, char* pAudioPath);
151
159
166 char* timeToString(struct tm* pTime);
167
174 int32_t MakeManifestMpd(sMediaPresentationDesc_t sMpd, char *pXml, uint32_t iToi, double dChunkPeriod, int32_t iId);
175
182 void SetDefaultFolder(char *pFolder);
183
190 void PutBandwidth(int32_t iMedaType, int32_t iBandwidth);
191
198 void UseManifest() {use_manifest = true;}
199
206 bool isIndex(){
207 return mIsIndex;
208 }
209private:
216 void UpdateM3u8(sHlsParameter_t param);
217
218 uint32_t mManifestPublish;
219 uint32_t mAstTime;
220 int32_t mServiceCategory;
221 bool mIsIndex;
222 bool mChangeBandwidth;
223 bool use_manifest;
224 std::string k_default_folder;
225 std::list<sMediaMasterPlaylistItem_t> mMasterPlaylist;
226 std::list<sHlsParameter_t> mDashList;
227 uint32_t mVideoSequenceNumber;
228};
229
230#endif// ATSC_CORE_STREAMER_HLSMARKER_H_
struct tMediaMasterPlayListItem sMediaMasterPlaylistItem_t
Definition atsc_core_streamer_hlsmaker.h:85
bool isIndex()
Verify index value.
Definition atsc_core_streamer_hlsmaker.h:206
void PutMedia(sHlsParameter_t sParam)
Add media.
void SetDefaultProperties(char *mime_type, char *init, char *media)
Set default value of properties.
void SetDefaultFolder(char *pFolder)
set folder for stream files
void GetInitData(char *pPath, char *pData, int32_t *iDataLen)
Get Init data for class.
void UseManifest()
use manifest values
Definition atsc_core_streamer_hlsmaker.h:198
void MakeIndex(std::list< sMediaMasterPlaylistItem_t > list)
Used to prepare index.
char * timeToString(struct tm *pTime)
Time to string update.
CHLSMaker()
Constructor of CHLSMaker.
void SetMasterItem(std::list< sMediaMasterPlaylistItem_t > list)
Set master item of sMediaMasterPlaylistItem_t list.
void Init(int32_t iCategory)
Initialization method.
void PutBandwidth(int32_t iMedaType, int32_t iBandwidth)
add band width
int32_t MakeManifestMpd(sMediaPresentationDesc_t sMpd, char *pXml, uint32_t iToi, double dChunkPeriod, int32_t iId)
Time to string update.
void GetMp4Parameter(char *pVideoPath, char *pAudioPath)
Read mp4 parameter for class.
~CHLSMaker()
Constructor of CHLSMaker.
Definition atsc_core_streamer_hlsmaker.h:74
std::string sPath
Definition atsc_core_streamer_hlsmaker.h:77
int32_t iMediaType
Definition atsc_core_streamer_hlsmaker.h:76
int32_t iTsi
Definition atsc_core_streamer_hlsmaker.h:75
Definition atsc_core_streamer_hlsmaker.h:40
int32_t iMediaType
Definition atsc_core_streamer_hlsmaker.h:42
double dExtinf
Definition atsc_core_streamer_hlsmaker.h:44
int32_t iTsi
Definition atsc_core_streamer_hlsmaker.h:43
uint32_t iSequence
Definition atsc_core_streamer_hlsmaker.h:41
std::string sUri
Definition atsc_core_streamer_hlsmaker.h:45
Definition atsc_core_atsc3_signaling_types.h:591
Definition atsc_core_streamer_hlsmaker.h:51
uint32_t iTsi
Definition atsc_core_streamer_hlsmaker.h:53
std::string sCodecs
Definition atsc_core_streamer_hlsmaker.h:57
std::string sMediaLocation
Definition atsc_core_streamer_hlsmaker.h:56
int32_t iMediaType
Definition atsc_core_streamer_hlsmaker.h:52
std::string sUri
Definition atsc_core_streamer_hlsmaker.h:58
int32_t iBandwidth
Definition atsc_core_streamer_hlsmaker.h:54
std::string sInitLocation
Definition atsc_core_streamer_hlsmaker.h:55