NVIDIA DeepStream SDK API Reference

9.1 Release
service-maker/includes/mediainfo.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
24 #ifndef NVIDIA_DEEPSTREAM_MEDIAINFO
25 #define NVIDIA_DEEPSTREAM_MEDIAINFO
26 
27 #include <string>
28 #include <memory>
29 #include <vector>
30 
31 namespace deepstream {
32 
33 struct StreamInfo {
34  std::string codec;
35 
36  StreamInfo() = default;
37  StreamInfo(const StreamInfo&) = default;
38  StreamInfo(StreamInfo&&) noexcept = default;
39  StreamInfo& operator=(const StreamInfo&) = default;
40  StreamInfo& operator=(StreamInfo&&) noexcept = default;
41  virtual ~StreamInfo() {}
42 };
43 
44 struct AudioStreamInfo : public StreamInfo {
45  unsigned int channels;
46  unsigned int sampling_rate;
47  AudioStreamInfo() = default;
48  AudioStreamInfo(const AudioStreamInfo&) = default;
49  AudioStreamInfo(AudioStreamInfo&&) noexcept = default;
50  AudioStreamInfo& operator=(const AudioStreamInfo&) = default;
51  AudioStreamInfo& operator=(AudioStreamInfo&&) noexcept = default;
52 };
53 
54 struct VideoStreamInfo : public StreamInfo {
55  unsigned int width;
56  unsigned int height;
57  struct {
58  unsigned int num;
59  unsigned int denom;
60  } framerate;
61  VideoStreamInfo() = default;
62  VideoStreamInfo(const VideoStreamInfo&) = default;
63  VideoStreamInfo(VideoStreamInfo&&) noexcept = default;
64  VideoStreamInfo& operator=(const VideoStreamInfo&) = default;
65  VideoStreamInfo& operator=(VideoStreamInfo&&) noexcept = default;
66 };
67 
68 struct MediaInfo {
69  bool error = false;
70  uint64_t duration = 0;
71  bool live = false;
72  operator bool() const { return !error; };
73  std::vector<std::unique_ptr<StreamInfo>> streams;
74  static std::unique_ptr<struct MediaInfo> discover(std::string uri);
75 };
76 
77 }
78 #endif
deepstream::VideoStreamInfo::denom
unsigned int denom
Definition: service-maker/includes/mediainfo.hpp:59
deepstream::MediaInfo
Definition: service-maker/includes/mediainfo.hpp:68
deepstream::VideoStreamInfo::width
unsigned int width
Definition: service-maker/includes/mediainfo.hpp:55
deepstream::AudioStreamInfo::channels
unsigned int channels
Definition: service-maker/includes/mediainfo.hpp:45
deepstream::VideoStreamInfo::height
unsigned int height
Definition: service-maker/includes/mediainfo.hpp:56
deepstream::AudioStreamInfo::AudioStreamInfo
AudioStreamInfo()=default
deepstream::StreamInfo
Definition: service-maker/includes/mediainfo.hpp:33
deepstream::VideoStreamInfo::num
unsigned int num
Definition: service-maker/includes/mediainfo.hpp:58
deepstream
Definition: service-maker/includes/buffer.hpp:38
deepstream::VideoStreamInfo
Definition: service-maker/includes/mediainfo.hpp:54
deepstream::StreamInfo::StreamInfo
StreamInfo()=default
deepstream::AudioStreamInfo::sampling_rate
unsigned int sampling_rate
Definition: service-maker/includes/mediainfo.hpp:46
deepstream::StreamInfo::codec
std::string codec
Definition: service-maker/includes/mediainfo.hpp:34
deepstream::AudioStreamInfo
Definition: service-maker/includes/mediainfo.hpp:44