DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
stream_descriptor.h
1 // Copyright 2014 Google Inc. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file or at
5 // https://developers.google.com/open-source/licenses/bsd
6 
7 #ifndef APP_STREAM_DESCRIPTOR_H_
8 #define APP_STREAM_DESCRIPTOR_H_
9 
10 #include <stdint.h>
11 
12 #include <set>
13 #include <string>
14 
15 #include "packager/media/base/container_names.h"
16 
17 namespace shaka {
18 namespace media {
19 
25 
26  std::string stream_selector;
27  std::string input;
28  std::string output;
29  std::string segment_template;
30  uint32_t bandwidth = 0;
31  std::string language;
32  MediaContainerName output_format = CONTAINER_UNKNOWN;
33  std::string hls_name;
34  std::string hls_group_id;
35  std::string hls_playlist_name;
36  uint32_t trick_play_factor = 0;
37  bool skip_encryption = false;
38 };
39 
41  public:
42  bool operator()(const StreamDescriptor& a, const StreamDescriptor& b) {
43  if (a.input == b.input) {
44  if (a.stream_selector == b.stream_selector)
45  // Stream with high trick_play_factor is at the beginning.
46  return a.trick_play_factor > b.trick_play_factor;
47  else
48  return a.stream_selector < b.stream_selector;
49  }
50 
51  return a.input < b.input;
52  }
53 };
54 
56 typedef std::multiset<StreamDescriptor, StreamDescriptorCompareFn>
57  StreamDescriptorList;
58 
66 bool InsertStreamDescriptor(const std::string& descriptor_string,
67  StreamDescriptorList* descriptor_list);
68 
69 } // namespace media
70 } // namespace shaka
71 
72 #endif // APP_STREAM_DESCRIPTOR_H_