GOPDownloadService.h
Go to the documentation of this file.
1 // Copyright (c) 2016 Digital Barriers
4 
34 #pragma once
35 
36 #include <memory>
37 #include "Stream.h"
38 #include "Service.h"
39 #include "OpResult.h"
40 
41 namespace EdgeVisDecoderSDK
42 {
43  class GOPDownloadServiceImpl;
44  class Encoder;
45  class Stream;
46  class IGOPDownloadListener;
47 
48  class GOPDownloadService : public Stream, public Service
49  {
50  public:
51  GOPDownloadService() {};
52  GOPDownloadService(std::weak_ptr<EncoderImpl> encoder, const std::wstring& name = L"", int32_t idleTimeoutMs = -1);
53  GOPDownloadService(const Stream& other);
54  DB_EDGEVIS_SDK virtual ~GOPDownloadService();
55 
60  DB_EDGEVIS_SDK void SetListener(IGOPDownloadListener * listener);
61 
90  DB_EDGEVIS_SDK OpResult DownloadGOPs(int64_t start_ts, int64_t end_ts, int32_t input, int32_t frame_height = 0, int32_t frame_step = 0, int32_t bitrate = 0);
91 
96  DB_EDGEVIS_SDK void AbortDownload();
97 
103  DB_EDGEVIS_SDK int32_t GetBandwidth();
104 
114  DB_EDGEVIS_SDK OpResult SetTargetBandwidth(int32_t bandwidth);
115 
121  DB_EDGEVIS_SDK int32_t GetTargetBandwidth();
122 
132  DB_EDGEVIS_SDK OpResult SetTargetBandwidthPercentage(int32_t bandwidthPercentage);
133 
140  DB_EDGEVIS_SDK int32_t GetTargetBandwidthPercentage();
141 
146  DB_EDGEVIS_SDK bool GetIsHighPriority() const;
147 
155  DB_EDGEVIS_SDK bool SetIsHighPriority(const bool high_priority);
156 
157  public:
165  DB_EDGEVIS_SDK virtual OpResult Start();
166 
173  DB_EDGEVIS_SDK virtual OpResult Stop();
174 
175  };
176 }
DB_EDGEVIS_SDK bool SetIsHighPriority(const bool high_priority)
Set whether to use high priority for GOP downloads.
Definition of the Service abstract class.
Definition: Service.h:48
DB_EDGEVIS_SDK bool GetIsHighPriority() const
Get if high priority is being used for GOP downloads.
DB_EDGEVIS_SDK int32_t GetTargetBandwidth()
Get the target bandwidth for the GOP download.
DB_EDGEVIS_SDK OpResult SetTargetBandwidth(int32_t bandwidth)
Set the target bandwidth usage of the GOP download.
The interface for the GOP download service callbacks.
Definition: IGOPDownloadListener.h:39
The Stream interface represent a service that is available on an Encoder.
Definition: Stream.h:50
DB_EDGEVIS_SDK int32_t GetTargetBandwidthPercentage()
Gets the target GOP download bandwidth usage percentage.
DB_EDGEVIS_SDK void SetListener(IGOPDownloadListener *listener)
Set the listener for the GOP download service.
DB_EDGEVIS_SDK OpResult DownloadGOPs(int64_t start_ts, int64_t end_ts, int32_t input, int32_t frame_height=0, int32_t frame_step=0, int32_t bitrate=0)
Request GOP download from the encoder for the given time frame and input.
The GOP Download Service handles the download of GOPs (Group of Pictures) from the edge archive of su...
Definition: GOPDownloadService.h:48
DB_EDGEVIS_SDK OpResult SetTargetBandwidthPercentage(int32_t bandwidthPercentage)
Sets the target GOP download bandwidth usage percentage.
DB_EDGEVIS_SDK void AbortDownload()
Abort any in-progress GOP download.
virtual DB_EDGEVIS_SDK OpResult Stop()
Stops the GOP download service.
virtual DB_EDGEVIS_SDK OpResult Start()
Starts the GOP download service.
The EdgeVis Decoder SDK namespace.
DB_EDGEVIS_SDK int32_t GetBandwidth()
Get the measured bandwidth usage of the GOP download.
OpResult
Result of an operation.
Definition: OpResult.h:25