Repository: xbmc/xbmc
File: xbmc/addons/kodi-dev-kit/include/kodi/addon-instance/PVR.h (C/C++)

Code before:
  /// @copydetails cpp_kodi_addon_pvr_Streams_TV_Demux_source_addon_auto_check
  ///
  ///@{

  //============================================================================
  /// @brief Get the stream properties of the stream that's currently being read.
  ///
  /// @param[in] properties The properties of the currently playing stream.
  /// @return @ref PVR_ERROR_NO_ERROR if the properties have been fetched successfully.
  ///
  /// @remarks Required, and only used if addon has its own demuxer.
  ///
  virtual PVR_ERROR GetStreamProperties(std::vector<kodi::addon::PVRStreamProperties>& properties)
  {
    return PVR_ERROR_NOT_IMPLEMENTED;
  }
  //----------------------------------------------------------------------------

  //============================================================================
  /// @brief The currently playing stream has been closed
  ///
  /// @remarks Called if both @ref PVRCapabilities::SetHandlesInputStream() or
  /// @ref PVRCapabilities::SetHandlesDemuxing() are set to false. Allows add-ons
  /// to do any cleanup required prior to a stream being opened.
  ///
  virtual void StreamClosed() {}
  //----------------------------------------------------------------------------

  //============================================================================
  /// @brief Read the next packet from the demultiplexer, if there is one.
  ///
  /// @return The next packet.
  /// If there is no next packet, then the add-on should return the packet
  /// created by calling @ref AllocateDemuxPacket(0) on the callback.
  /// If the stream changed and Kodi's player needs to be reinitialised, then,
  /// the add-on should call @ref AllocateDemuxPacket(0) on the callback, and set
  /// the streamid to @ref DMX_SPECIALID_STREAMCHANGE and return the value.
  /// The add-on should return `nullptr` if an error occurred.
  ///
  /// @remarks Required, and only used if addon has its own demuxer.
  /// Return `nullptr` if this add-on won't provide this function.
  ///
  virtual DEMUX_PACKET* DemuxRead() { return nullptr; }
  //----------------------------------------------------------------------------

  //============================================================================
  /// @brief Reset the demultiplexer in the add-on.
  ///
  /// @remarks Required, and only used if addon has its own demuxer.
  ///
  virtual void DemuxReset() {}

Review comment (suggestion):
Should return a `PVR_ERROR` and the default implementation should return `PVR_ERROR_NOT_IMPLEMENTED`.

Code after:
  ///
  /// @copydetails cpp_kodi_addon_pvr_Streams_TV_Demux_header_addon_auto_check
  /// @copydetails cpp_kodi_addon_pvr_Streams_TV_Demux_source_addon_auto_check
  ///
  ///@{

  //============================================================================
  /// @brief Get the stream properties of the stream that's currently being read.
  ///
  /// @param[in] properties The properties of the currently playing stream.
  /// @return @ref PVR_ERROR_NO_ERROR if the properties have been fetched successfully.
  ///
  /// @remarks Required, and only used if addon has its own demuxer.
  ///
  virtual PVR_ERROR GetStreamProperties(std::vector<kodi::addon::PVRStreamProperties>& properties)
  {
    return PVR_ERROR_NOT_IMPLEMENTED;
  }
  //----------------------------------------------------------------------------

  //============================================================================
  /// @brief The currently playing stream has been closed
  ///
  /// @remarks Called if both @ref PVRCapabilities::SetHandlesInputStream() or
  /// @ref PVRCapabilities::SetHandlesDemuxing() are set to false. Allows add-ons
  /// to do any cleanup required prior to a stream being opened.
  /// @return @ref PVR_ERROR_NO_ERROR if the properties have been fetched successfully.
  ///
  virtual PVR_ERROR StreamClosed() { return PVR_ERROR_NOT_IMPLEMENTED; }
  //----------------------------------------------------------------------------

  //============================================================================
  /// @brief Read the next packet from the demultiplexer, if there is one.
  ///
  /// @return The next packet.
  /// If there is no next packet, then the add-on should return the packet
  /// created by calling @ref AllocateDemuxPacket(0) on the callback.
  /// If the stream changed and Kodi's player needs to be reinitialised, then,
  /// the add-on should call @ref AllocateDemuxPacket(0) on the callback, and set
  /// the streamid to @ref DMX_SPECIALID_STREAMCHANGE and return the value.
  /// The add-on should return `nullptr` if an error occurred.
  ///
  /// @remarks Required, and only used if addon has its own demuxer.
  /// Return `nullptr` if this add-on won't provide this function.
  ///
  virtual DEMUX_PACKET* DemuxRead() { return nullptr; }
  //----------------------------------------------------------------------------

  //============================================================================
  /// @brief Reset the demultiplexer in the add-on.
  ///