summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_stream.h
blob: aaca30e08b3b06f57a93900ab3e93ac84b879312 (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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/*
 *  Copyright (C) 2005-2018 Team Kodi
 *  This file is part of Kodi - https://kodi.tv
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *  See LICENSES/README.md for more information.
 */

#ifndef C_API_ADDONINSTANCE_PVR_STREAM_H
#define C_API_ADDONINSTANCE_PVR_STREAM_H

#include "../inputstream/demux_packet.h"
#include "pvr_defines.h"

#include <stdint.h>
#include <time.h>

//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
// "C" Definitions group 9 - PVR stream definitions (NOTE: Becomes replaced
// in future by inputstream addon instance way)
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */

  //============================================================================
  /// @ingroup cpp_kodi_addon_pvr_Defs_Stream
  /// @brief Maximum of allowed streams
  ///
  #define PVR_STREAM_MAX_STREAMS 20
  //----------------------------------------------------------------------------

  //============================================================================
  /// @ingroup cpp_kodi_addon_pvr_Defs_Stream
  /// @brief Invalid codec identifier
  ///
  #define PVR_INVALID_CODEC_ID 0
  //----------------------------------------------------------------------------

  //============================================================================
  /// @ingroup cpp_kodi_addon_pvr_Defs_Stream
  /// @brief Invalid codec
  ///
  #define PVR_INVALID_CODEC \
    { \
      PVR_CODEC_TYPE_UNKNOWN, PVR_INVALID_CODEC_ID \
    }
  //----------------------------------------------------------------------------

  //============================================================================
  /// @defgroup cpp_kodi_addon_pvr_Defs_Stream_PVR_CODEC_TYPE enum PVR_CODEC_TYPE
  /// @ingroup cpp_kodi_addon_pvr_Defs_Stream
  /// @brief **Inputstream types**\n
  /// To identify type on stream.
  ///
  /// Used on @ref kodi::addon::PVRStreamProperties::SetCodecType and @ref kodi::addon::PVRStreamProperties::SetCodecType.
  ///
  ///@{
  typedef enum PVR_CODEC_TYPE
  {
    /// @brief To set nothing defined.
    PVR_CODEC_TYPE_UNKNOWN = -1,

    /// @brief To identify @ref cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties as Video.
    PVR_CODEC_TYPE_VIDEO,

    /// @brief To identify @ref cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties as Audio.
    PVR_CODEC_TYPE_AUDIO,

    /// @brief To identify @ref cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties as Data.
    ///
    /// With codec id related source identified.
    PVR_CODEC_TYPE_DATA,

    /// @brief To identify @ref cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties as Subtitle.
    PVR_CODEC_TYPE_SUBTITLE,

    /// @brief To identify @ref cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties as Radio RDS.
    PVR_CODEC_TYPE_RDS,

    PVR_CODEC_TYPE_NB
  } PVR_CODEC_TYPE;
  ///@}
  //----------------------------------------------------------------------------

  //============================================================================
  /// @defgroup cpp_kodi_addon_pvr_Defs_Stream_PVR_CODEC struct PVR_CODEC
  /// @ingroup cpp_kodi_addon_pvr_Defs_Stream
  /// @brief **Codec identification structure**\n
  /// Identifier about stream between Kodi and addon.
  ///
  ///@{
  typedef struct PVR_CODEC
  {
    /// @brief Used codec type for stream.
    enum PVR_CODEC_TYPE codec_type;

    /// @brief Related codec identifier, normally match the ffmpeg id's.
    unsigned int codec_id;
  } PVR_CODEC;
  ///@}
  //----------------------------------------------------------------------------

  /*!
   * @brief "C" Stream properties
   *
   * Structure used to interface in "C" between Kodi and Addon.
   *
   * See @ref cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties for description of values.
   */
  typedef struct PVR_STREAM_PROPERTIES
  {
    unsigned int iStreamCount;
    struct PVR_STREAM
    {
      unsigned int iPID;
      enum PVR_CODEC_TYPE iCodecType;
      unsigned int iCodecId;
      char strLanguage[4];
      int iSubtitleInfo;
      int iFPSScale;
      int iFPSRate;
      int iHeight;
      int iWidth;
      float fAspect;
      int iChannels;
      int iSampleRate;
      int iBlockAlign;
      int iBitRate;
      int iBitsPerSample;
    } stream[PVR_STREAM_MAX_STREAMS];
  } PVR_STREAM_PROPERTIES;

  /*!
   * @brief "C" Times of playing stream (Live TV and recordings)
   *
   * Structure used to interface in "C" between Kodi and Addon.
   *
   * See @ref cpp_kodi_addon_pvr_Defs_Stream_PVRStreamTimes for description of values.
   */
  typedef struct PVR_STREAM_TIMES
  {
    time_t startTime;
    int64_t ptsStart;
    int64_t ptsBegin;
    int64_t ptsEnd;
  } PVR_STREAM_TIMES;

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* !C_API_ADDONINSTANCE_PVR_STREAM_H */