summaryrefslogtreecommitdiff
path: root/sys/uvch264/uvc_h264.c
blob: 07632f3d816a39546cd3be2fc0cb6505ad6730cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/*
 * GStreamer
 *
 * Copyright (C) 2012 Cisco Systems, Inc.
 *   Author: Youness Alaoui <youness.alaoui@collabora.co.uk>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */


#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include "uvc_h264.h"

GType
uvc_h264_slicemode_get_type (void)
{
  static GType type = 0;

  static const GEnumValue types[] = {
    {UVC_H264_SLICEMODE_IGNORED, "Ignored", "ignored"},
    {UVC_H264_SLICEMODE_BITSPERSLICE, "Bits per slice", "bits/slice"},
    {UVC_H264_SLICEMODE_MBSPERSLICE, "MBs per Slice", "MBs/slice"},
    {UVC_H264_SLICEMODE_SLICEPERFRAME, "Slice Per Frame", "slice/frame"},
    {0, NULL, NULL}
  };

  if (!type) {
    type = g_enum_register_static ("UvcH264SliceMode", types);
  }
  return type;
}

GType
uvc_h264_usagetype_get_type (void)
{
  static GType type = 0;

  static const GEnumValue types[] = {
    {UVC_H264_USAGETYPE_REALTIME, "Realtime (video conferencing)", "realtime"},
    {UVC_H264_USAGETYPE_BROADCAST, "Broadcast", "broadcast"},
    {UVC_H264_USAGETYPE_STORAGE, "Storage", "storage"},
    {UVC_H264_USAGETYPE_UCCONFIG_0, "UCConfig 0", "ucconfig0"},
    {UVC_H264_USAGETYPE_UCCONFIG_1, "UCConfig 1", "ucconfig1"},
    {UVC_H264_USAGETYPE_UCCONFIG_2Q, "UCConfig 2Q", "ucconfig2q"},
    {UVC_H264_USAGETYPE_UCCONFIG_2S, "UCConfig 2S", "ucconfig2s"},
    {UVC_H264_USAGETYPE_UCCONFIG_3, "UCConfig 3", "ucconfig3"},
    {0, NULL, NULL}
  };

  if (!type) {
    type = g_enum_register_static ("UvcH264UsageType", types);
  }
  return type;
}

GType
uvc_h264_ratecontrol_get_type (void)
{
  static GType type = 0;

  static const GEnumValue types[] = {
    {UVC_H264_RATECONTROL_CBR, "Constant bit rate", "cbr"},
    {UVC_H264_RATECONTROL_VBR, "Variable bit rate", "vbr"},
    {UVC_H264_RATECONTROL_CONST_QP, "Constant QP", "qp"},
    {0, NULL, NULL}
  };

  if (!type) {
    type = g_enum_register_static ("UvcH264RateControl", types);
  }
  return type;
}

GType
uvc_h264_streamformat_get_type (void)
{
  static GType type = 0;

  static const GEnumValue types[] = {
    {UVC_H264_STREAMFORMAT_ANNEXB, "Byte stream format (Annex B)", "byte"},
    {UVC_H264_STREAMFORMAT_NAL, "NAL stream format", "nal"},
    {0, NULL, NULL}
  };

  if (!type) {
    type = g_enum_register_static ("UvcH264StreamFormat", types);
  }
  return type;
}

GType
uvc_h264_entropy_get_type (void)
{
  static GType type = 0;

  static const GEnumValue types[] = {
    {UVC_H264_ENTROPY_CAVLC, "CAVLC", "cavlc"},
    {UVC_H264_ENTROPY_CABAC, "CABAC", "cabac"},
    {0, NULL, NULL}
  };

  if (!type) {
    type = g_enum_register_static ("UvcH264Entropy", types);
  }
  return type;
}