Shaka Packager SDK
retired_flags.cc
1 // Copyright 2017 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 // Defines retired / deprecated flags. These flags will be removed in later
8 // versions.
9 
10 #include "packager/app/retired_flags.h"
11 
12 #include <stdio.h>
13 
14 DEFINE_string(profile, "", "This flag is deprecated. Do not use.");
15 DEFINE_bool(single_segment, true, "This flag is deprecated. Do not use.");
16 DEFINE_bool(webm_subsample_encryption,
17  true,
18  "This flag is deprecated. Use vp9_subsample_encryption instead.");
19 DEFINE_double(availability_time_offset,
20  0,
21  "This flag is deprecated. Use suggested_presentation_delay "
22  "instead which can achieve similar effect.");
23 DEFINE_string(playready_key_id,
24  "",
25  "This flag is deprecated. Use --enable_raw_key_encryption with "
26  "--generate_playready_pssh to generate PlayReady PSSH.");
27 DEFINE_string(playready_key,
28  "",
29  "This flag is deprecated. Use --enable_raw_key_encryption with "
30  "--generate_playready_pssh to generate PlayReady PSSH.");
31 
32 // The current gflags library does not provide a way to check whether a flag is
33 // set in command line. If a flag has a different value to its default value,
34 // the flag must have been set. It is possible that the flag is set to the same
35 // value as its default value though.
36 bool InformRetiredStringFlag(const char* flagname, const std::string& value) {
37  if (!value.empty())
38  fprintf(stderr, "WARNING: %s is deprecated and ignored.\n", flagname);
39  return true;
40 }
41 
42 bool InformRetiredDefaultTrueFlag(const char* flagname, bool value) {
43  if (!value)
44  fprintf(stderr, "WARNING: %s is deprecated and ignored.\n", flagname);
45  return true;
46 }
47 
48 bool InformRetiredDefaultDoubleFlag(const char* flagname, double value) {
49  if (value != 0)
50  fprintf(stderr, "WARNING: %s is deprecated and ignored.\n", flagname);
51  return true;
52 }
53 
54 DEFINE_validator(profile, &InformRetiredStringFlag);
55 DEFINE_validator(single_segment, &InformRetiredDefaultTrueFlag);
56 DEFINE_validator(webm_subsample_encryption, &InformRetiredDefaultTrueFlag);
57 DEFINE_validator(availability_time_offset, &InformRetiredDefaultDoubleFlag);
58 DEFINE_validator(playready_key_id, &InformRetiredStringFlag);
59 DEFINE_validator(playready_key, &InformRetiredStringFlag);