DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
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 
20 // The current gflags library does not provide a way to check whether a flag is
21 // set in command line. If a flag has a different value to its default value,
22 // the flag must have been set. It is possible that the flag is set to the same
23 // value as its default value though.
24 bool InformRetiredStringFlag(const char* flagname, const std::string& value) {
25  if (!value.empty())
26  fprintf(stderr, "WARNING: %s is deprecated and ignored.\n", flagname);
27  return true;
28 }
29 
30 bool InformRetiredDefaultTrueFlag(const char* flagname, bool value) {
31  if (!value)
32  fprintf(stderr, "WARNING: %s is deprecated and ignored.\n", flagname);
33  return true;
34 }
35 
36 DEFINE_validator(profile, &InformRetiredStringFlag);
37 DEFINE_validator(single_segment, &InformRetiredDefaultTrueFlag);
38 DEFINE_validator(webm_subsample_encryption, &InformRetiredDefaultTrueFlag);