ronantakizawa/codereview-bench huggingface dataset:
Repository: xbmc/xbmc
File: xbmc/video/VideoEmbeddedImageFileLoader.cpp (C++)

Code before:
 */

#include "VideoEmbeddedImageFileLoader.h"

#include "FileItem.h"
#include "guilib/Texture.h"
#include "utils/EmbeddedArt.h"
#include "utils/StringUtils.h"
#include "video/VideoInfoTag.h"
#include "video/tags/IVideoInfoTagLoader.h"
#include "video/tags/VideoInfoTagLoaderFactory.h"

using namespace VIDEO;

bool CVideoEmbeddedImageFileLoader::CanLoad(std::string specialType) const
{
  return StringUtils::StartsWith(specialType, "video_");
}

namespace
{
bool GetEmbeddedThumb(const std::string& path, const std::string& type, EmbeddedArt& art)
{
  CFileItem item(path, false);
  std::unique_ptr<IVideoInfoTagLoader> pLoader;
  pLoader.reset(CVideoInfoTagLoaderFactory::CreateLoader(item, ADDON::ScraperPtr(), false));
  CVideoInfoTag tag;
  std::vector<EmbeddedArt> artv;
  if (pLoader)
    pLoader->Load(tag, false, &artv);

  for (const EmbeddedArt& it : artv)
  {
    if (it.m_type == type)
    {
      art = it;
      break;
    }
  }
  return !art.Empty();
}
} // namespace

std::unique_ptr<CTexture> CVideoEmbeddedImageFileLoader::Load(
    std::string specialType,
    std::string filePath,
    unsigned int preferredWidth,
    unsigned int preferredHeight) const
{
  EmbeddedArt art;
  if (GetEmbeddedThumb(filePath, specialType.substr(6), art))

Review comment (suggestion):
Just assign this in he last line

```suggestion
  = CVideoInfoTagLoaderFactory::CreateLoader(item, ADDON::ScraperPtr(), false);
```


Code after:
 */

#include "VideoEmbeddedImageFileLoader.h"

#include "FileItem.h"
#include "guilib/Texture.h"
#include "utils/EmbeddedArt.h"
#include "utils/StringUtils.h"
#include "video/VideoInfoTag.h"
#include "video/tags/IVideoInfoTagLoader.h"
#include "video/tags/VideoInfoTagLoaderFactory.h"

using namespace VIDEO;

bool CVideoEmbeddedImageFileLoader::CanLoad(std::string specialType) const
{
  return StringUtils::StartsWith(specialType, "video_");
}

namespace
{
bool GetEmbeddedThumb(const std::string& path, const std::string& type, EmbeddedArt& art)
{
  CFileItem item(path, false);
  std::unique_ptr<IVideoInfoTagLoader> loader(
      CVideoInfoTagLoaderFactory::CreateLoader(item, ADDON::ScraperPtr(), false));
  CVideoInfoTag tag;
  std::vector<EmbeddedArt> artv;
  if (loader)
    loader->Load(tag, false, &artv);

  for (const auto& it : artv)
  {
    if (it.m_type == type)
    {
      art = it;
      break;
    }
  }
  return !art.Empty();
}
} // namespace

std::unique_ptr<CTexture> CVideoEmbeddedImageFileLoader::Load(std::string specialType,
                                                              std::string filePath,
                                                              unsigned int preferredWidth,
                                                              unsigned int preferredHeight) const
{
  EmbeddedArt art;
  if (GetEmbeddedThumb(filePath, specialType.substr(6), art))
    return CTexture::LoadFromFileInMemory(art.m_data.data(), art.m_size, art.m_mime, preferredWidth,
Repository: xbmc/xbmc
File: xbmc/video/VideoEmbeddedImageFileLoader.h (C/C++)

Code before:
/*
 *  Copyright (C) 2023 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.
 */

#pragma once

#include "imagefiles/SpecialImageFileLoader.h"

namespace VIDEO
{

class CVideoEmbeddedImageFileLoader : public IMAGE_FILES::ISpecialImageFileLoader
{
public:
  CVideoEmbeddedImageFileLoader() = default;
  ~CVideoEmbeddedImageFileLoader() = default;

  bool CanLoad(std::string specialType) const override;
  std::unique_ptr<CTexture> Load(std::string specialType,
                                 std::string filePath,
                                 unsigned int preferredWidth,
                                 unsigned int preferredHeight) const override;
};

} // namespace VIDEO


Review comment (suggestion):
```suggestion
  ~CVideoEmbeddedImageFileLoader() override = default;
```

Code after:
/*
 *  Copyright (C) 2023 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.
 */

#pragma once

#include "imagefiles/SpecialImageFileLoader.h"

namespace VIDEO
{

class CVideoEmbeddedImageFileLoader : public IMAGE_FILES::ISpecialImageFileLoader
{
public:
  CVideoEmbeddedImageFileLoader() = default;
  ~CVideoEmbeddedImageFileLoader() override = default;

  bool CanLoad(std::string specialType) const override;
  std::unique_ptr<CTexture> Load(std::string specialType,
                                 std::string filePath,
                                 unsigned int preferredWidth,
                                 unsigned int preferredHeight) const override;
};

} // namespace VIDEO
Repository: xbmc/xbmc
File: xbmc/music/MusicEmbeddedImageFileLoader.h (C/C++)

Code before:
/*
 *  Copyright (C) 2023 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.
 */

#pragma once

#include "imagefiles/SpecialImageFileLoader.h"

namespace MUSIC_INFO
{

class CMusicEmbeddedImageFileLoader : public IMAGE_FILES::ISpecialImageFileLoader
{
public:
  CMusicEmbeddedImageFileLoader() = default;
  ~CMusicEmbeddedImageFileLoader() = default;

  bool CanLoad(std::string specialType) const override;
  std::unique_ptr<CTexture> Load(std::string specialType,
                                 std::string filePath,
                                 unsigned int preferredWidth,
                                 unsigned int preferredHeight) const override;
};
} // namespace MUSIC_INFO


Review comment (suggestion):
```suggestion
  ~CMusicEmbeddedImageFileLoader() override = default;
```

Code after:
/*
 *  Copyright (C) 2023 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.
 */

#pragma once

#include "imagefiles/SpecialImageFileLoader.h"

namespace MUSIC_INFO
{

class CMusicEmbeddedImageFileLoader : public IMAGE_FILES::ISpecialImageFileLoader
{
public:
  CMusicEmbeddedImageFileLoader() = default;
  ~CMusicEmbeddedImageFileLoader() override = default;

  bool CanLoad(std::string specialType) const override;
  std::unique_ptr<CTexture> Load(std::string specialType,
                                 std::string filePath,
                                 unsigned int preferredWidth,
                                 unsigned int preferredHeight) const override;
};
} // namespace MUSIC_INFO
Repository: xbmc/xbmc
File: xbmc/TextureCacheJob.h (C/C++)

Code before:
 \ingroup textures
 \brief Simple class for passing texture detail around
 */
class CTextureDetails
{
public:
  CTextureDetails()
  {
    id = -1;
    width = height = 0;
    updateable = false;
    hashRevalidated = false;
  };
  bool operator==(const CTextureDetails &right) const
  {
    return (id    == right.id    &&
            file  == right.file  &&
            width == right.width );
  };
  int          id;
  std::string  file;
  std::string  hash;
  unsigned int width;
  unsigned int height;
  bool         updateable;
  bool hashRevalidated;
};

/*!
 \ingroup textures
 \brief Job class for caching textures

 Handles loading and caching of textures.
 */
class CTextureCacheJob : public CJob
{
public:
  CTextureCacheJob(const std::string &url, const std::string &oldHash = "");
  ~CTextureCacheJob() override;

  const char* GetType() const override { return kJobTypeCacheImage; }
  bool operator==(const CJob *job) const override;
  bool DoWork() override;

  /*! \brief retrieve a hash for the given image
   Combines the size, ctime and mtime of the image file into a "unique" hash
   \param url location of the image
   \return a hash string for this image
   */
  bool CacheTexture(std::unique_ptr<CTexture>* texture = nullptr);


Review comment (suggestion):
Please use `bool hashRevalidated{false};` (and line in constructor can be removed).

Code after:
 \ingroup textures
 \brief Simple class for passing texture detail around
 */
class CTextureDetails
{
public:
  bool operator==(const CTextureDetails &right) const
  {
    return (id    == right.id    &&
            file  == right.file  &&
            width == right.width );
  };

  int id{-1};
  std::string file;
  std::string hash;
  unsigned int width{0};
  unsigned int height{0};
  bool updateable{false};
  bool hashRevalidated{false};
};

/*!
 \ingroup textures
 \brief Job class for caching textures

 Handles loading and caching of textures.
 */
class CTextureCacheJob : public CJob
{
public:
  CTextureCacheJob(const std::string &url, const std::string &oldHash = "");
  ~CTextureCacheJob() override;

  const char* GetType() const override { return kJobTypeCacheImage; }
  bool operator==(const CJob *job) const override;
  bool DoWork() override;

  /*! \brief retrieve a hash for the given image
   Combines the size, ctime and mtime of the image file into a "unique" hash
   \param url location of the image
   \return a hash string for this image
   */
  bool CacheTexture(std::unique_ptr<CTexture>* texture = nullptr);

  static bool ResizeTexture(const std::string &url, uint8_t* &result, size_t &result_size);

  std::string m_url;
  std::string m_oldHash;
  CTextureDetails m_details;
private:
Repository: xbmc/xbmc
File: xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_recordings.h (C/C++)

Code before:
    char strPlot[PVR_ADDON_DESC_STRING_LENGTH];
    char strGenreDescription[PVR_ADDON_DESC_STRING_LENGTH];
    char strChannelName[PVR_ADDON_NAME_STRING_LENGTH];
    char strIconPath[PVR_ADDON_URL_STRING_LENGTH];
    char strThumbnailPath[PVR_ADDON_URL_STRING_LENGTH];
    char strFanartPath[PVR_ADDON_URL_STRING_LENGTH];
    time_t recordingTime;
    int iDuration;
    int iPriority;
    int iLifetime;
    int iGenreType;
    int iGenreSubType;
    int iPlayCount;
    int iLastPlayedPosition;
    bool bIsDeleted;
    unsigned int iEpgEventId;
    int iChannelUid;
    enum PVR_RECORDING_CHANNEL_TYPE channelType;
    char strFirstAired[PVR_ADDON_DATE_STRING_LENGTH];
    unsigned int iFlags;
    int64_t sizeInBytes;
    int iClientProviderUid;
    char strProviderName[PVR_ADDON_NAME_STRING_LENGTH];
    int iParentalRating;
    char strParentalRatingCode[PVR_ADDON_RATING_CODE_LENGTH];
    char strParentalRatingIcon[PVR_ADDON_RATING_ICON_LENGTH];
  } PVR_RECORDING;

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* !C_API_ADDONINSTANCE_PVR_RECORDINGS_H */


Review comment (suggestion):
Remark: Maybe we need to revise this later, because for P we want to get rid of fixed size arrays in the (at least for fields carrying URLs), but we have no details for this, as of now.

Code after:
    const char* strPlotOutline;
    const char* strPlot;
    const char* strGenreDescription;
    const char* strChannelName;
    const char* strIconPath;
    const char* strThumbnailPath;
    const char* strFanartPath;
    time_t recordingTime;
    int iDuration;
    int iPriority;
    int iLifetime;
    int iGenreType;
    int iGenreSubType;
    int iPlayCount;
    int iLastPlayedPosition;
    bool bIsDeleted;
    unsigned int iEpgEventId;
    int iChannelUid;
    enum PVR_RECORDING_CHANNEL_TYPE channelType;
    const char* strFirstAired;
    unsigned int iFlags;
    int64_t sizeInBytes;
    int iClientProviderUid;
    const char* strProviderName;
    unsigned int iParentalRating;
    const char* strParentalRatingCode;
    const char* strParentalRatingIcon;
    const char* strParentalRatingSource;
  } PVR_RECORDING;

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* !C_API_ADDONINSTANCE_PVR_RECORDINGS_H */
Repository: xbmc/xbmc
File: xbmc/pvr/epg/EpgInfoTag.h (C/C++)

Code before:
   */
  CDateTime FirstAired() const;

  /*!
   * @brief Get the parental rating of this event.
   * @return The parental rating.
   */
  unsigned int ParentalRating() const;

  /*!
   * @brief Get the parental rating code of this event.
   * @return The parental rating code.
   */
  const std::string& ParentalRatingCode() const;

  /*!
   * @brief Get the parental rating icon path of this event.
   * @return Path to the parental rating icon.
   */
  const std::string& ParentalRatingIcon() const;

  /*!
   * @brief Get the parental rating source of this event.
   * @return The parental rating source.
   */
  const std::string& ParentalRatingSource() const;
  /*!
   * @brief Get the star rating of this event.
   * @return The star rating.
   */
  int StarRating() const;

  /*!
   * @brief The series number of this event.
   * @return The series number.
   */
  int SeriesNumber() const;

  /*!
   * @brief The series link for this event.
   * @return The series link or empty string, if not available.
   */
  const std::string& SeriesLink() const { return m_strSeriesLink; }

  /*!
   * @brief The episode number of this event.
   * @return The episode number.
   */
  int EpisodeNumber() const;

  /*!

Review comment (suggestion):
Change these two methods to be inline, like `ParentalRationCode()`.

Code after:
   */
  CDateTime FirstAired() const;

  /*!
   * @brief Get the parental rating of this event.
   * @return The parental rating.
   */
  unsigned int ParentalRating() const;

  /*!
   * @brief Get the parental rating code of this event.
   * @return The parental rating code.
   */
  const std::string& ParentalRatingCode() const { return m_parentalRatingCode; }

  /*!
   * @brief Get the parental rating icon path of this event.
   * @return Path to the parental rating icon.
   */
  const std::string& ParentalRatingIcon() const { return m_parentalRatingIcon; }

  /*!
   * @brief Get the parental rating source of this event.
   * @return The parental rating source.
   */
  const std::string& ParentalRatingSource() const { return m_parentalRatingSource; }
  /*!
   * @brief Get the star rating of this event.
   * @return The star rating.
   */
  int StarRating() const;

  /*!
   * @brief The series number of this event.
   * @return The series number.
   */
  int SeriesNumber() const;

  /*!
   * @brief The series link for this event.
   * @return The series link or empty string, if not available.
   */
  const std::string& SeriesLink() const { return m_strSeriesLink; }

  /*!
   * @brief The episode number of this event.
   * @return The episode number.
   */
  int EpisodeNumber() const;

  /*!
Repository: xbmc/xbmc
File: xbmc/filesystem/FileCache.cpp (C++)

Code before:
{
  return m_fileSize;
}

void CFileCache::StopThread(bool bWait /*= true*/)
{
  m_bStop = true;
  //Process could be waiting for seekEvent
  m_seekEvent.Set();
  CThread::StopThread(bWait);
}

const std::string CFileCache::GetProperty(XFILE::FileProperty type, const std::string &name) const
{
  if (!m_source.GetImplementation())
    return IFile::GetProperty(type, name);

  return m_source.GetImplementation()->GetProperty(type, name);
}

int CFileCache::IoControl(EIoControl request, void* param)
{
  if (request == IOCTRL_CACHE_STATUS)
  {
    SCacheStatus* status = (SCacheStatus*)param;
    status->maxforward = m_forwardCacheSize;
    status->forward = m_pCache->WaitForData(0, 0ms);
    status->maxrate = m_writeRate;
    status->currate = m_writeRateActual;
    status->lowrate = m_writeRateLowSpeed;
    m_writeRateLowSpeed = 0; // Reset low speed condition
    return 0;
  }

  if (request == IOCTRL_CACHE_SETRATE)
  {
    m_writeRate = *static_cast<uint32_t*>(param);
    return 0;
  }

  if (request == IOCTRL_SEEK_POSSIBLE)
    return m_seekPossible;

  return -1;
}


Review comment (performance):
Perhaps make this: status->maxforward = m_forwardCacheSize ? m_forwardCacheSize : m_fileSize; ? This allows cache level calculation when disk-cache is used.

Code after:
{
  return m_fileSize;
}

void CFileCache::StopThread(bool bWait /*= true*/)
{
  m_bStop = true;
  //Process could be waiting for seekEvent
  m_seekEvent.Set();
  CThread::StopThread(bWait);
}

const std::string CFileCache::GetProperty(XFILE::FileProperty type, const std::string &name) const
{
  if (!m_source.GetImplementation())
    return IFile::GetProperty(type, name);

  return m_source.GetImplementation()->GetProperty(type, name);
}

int CFileCache::IoControl(EIoControl request, void* param)
{
  if (request == IOCTRL_CACHE_STATUS)
  {
    SCacheStatus* status = (SCacheStatus*)param;
    status->maxforward =
        (m_forwardCacheSize != 0) ? m_forwardCacheSize : static_cast<uint64_t>(m_fileSize);
    status->forward = m_pCache->WaitForData(0, 0ms);
    status->maxrate = m_writeRate;
    status->currate = m_writeRateActual;
    status->lowrate = m_writeRateLowSpeed;
    m_writeRateLowSpeed = 0; // Reset low speed condition
    return 0;
  }

  if (request == IOCTRL_CACHE_SETRATE)
  {
    m_writeRate = *static_cast<uint32_t*>(param);
    return 0;
  }

  if (request == IOCTRL_SEEK_POSSIBLE)
    return m_seekPossible;

  return -1;
}
Repository: xbmc/xbmc
File: xbmc/filesystem/FileCache.cpp (C++)

Code before:
  return m_fileSize;
}

void CFileCache::StopThread(bool bWait /*= true*/)
{
  m_bStop = true;
  //Process could be waiting for seekEvent
  m_seekEvent.Set();
  CThread::StopThread(bWait);
}

const std::string CFileCache::GetProperty(XFILE::FileProperty type, const std::string &name) const
{
  if (!m_source.GetImplementation())
    return IFile::GetProperty(type, name);

  return m_source.GetImplementation()->GetProperty(type, name);
}

int CFileCache::IoControl(EIoControl request, void* param)
{
  if (request == IOCTRL_CACHE_STATUS)
  {
    SCacheStatus* status = (SCacheStatus*)param;
    status->maxforward =
        (m_forwardCacheSize) ? m_forwardCacheSize : static_cast<uint64_t>(m_fileSize);
    status->forward = m_pCache->WaitForData(0, 0ms);
    status->maxrate = m_writeRate;
    status->currate = m_writeRateActual;
    status->lowrate = m_writeRateLowSpeed;
    m_writeRateLowSpeed = 0; // Reset low speed condition
    return 0;
  }

  if (request == IOCTRL_CACHE_SETRATE)
  {
    m_writeRate = *static_cast<uint32_t*>(param);
    return 0;
  }

  if (request == IOCTRL_SEEK_POSSIBLE)
    return m_seekPossible;

  return -1;
}


Review comment (performance):
```suggestion
        (m_forwardCacheSize != 0) ? m_forwardCacheSize : static_cast<uint64_t>(m_fileSize);
```

Code after:
  return m_fileSize;
}

void CFileCache::StopThread(bool bWait /*= true*/)
{
  m_bStop = true;
  //Process could be waiting for seekEvent
  m_seekEvent.Set();
  CThread::StopThread(bWait);
}

const std::string CFileCache::GetProperty(XFILE::FileProperty type, const std::string &name) const
{
  if (!m_source.GetImplementation())
    return IFile::GetProperty(type, name);

  return m_source.GetImplementation()->GetProperty(type, name);
}

int CFileCache::IoControl(EIoControl request, void* param)
{
  if (request == IOCTRL_CACHE_STATUS)
  {
    SCacheStatus* status = (SCacheStatus*)param;
    status->maxforward =
        (m_forwardCacheSize != 0) ? m_forwardCacheSize : static_cast<uint64_t>(m_fileSize);
    status->forward = m_pCache->WaitForData(0, 0ms);
    status->maxrate = m_writeRate;
    status->currate = m_writeRateActual;
    status->lowrate = m_writeRateLowSpeed;
    m_writeRateLowSpeed = 0; // Reset low speed condition
    return 0;
  }

  if (request == IOCTRL_CACHE_SETRATE)
  {
    m_writeRate = *static_cast<uint32_t*>(param);
    return 0;
  }

  if (request == IOCTRL_SEEK_POSSIBLE)
    return m_seekPossible;

  return -1;
}
Repository: xbmc/xbmc
File: xbmc/windowing/gbm/drm/DRMObject.cpp (C++)

Code before:
{
  auto property = std::find_if(m_propsInfo.begin(), m_propsInfo.end(),
                               [&name](const auto& prop) { return prop->name == name; });

  if (property != m_propsInfo.end())
  {
    int ret = drmModeObjectSetProperty(m_fd, m_id, m_type, property->get()->prop_id, value);
    if (ret == 0)
      return true;
  }

  return false;
}

bool CDRMObject::SupportsProperty(const std::string& name)
{
  auto property = std::find_if(m_propsInfo.begin(), m_propsInfo.end(),
                               [&name](const auto& prop) { return prop->name == name; });

  if (property != m_propsInfo.end())
    return true;

  return false;
}

std::optional<bool> CDRMObject::IsPropertyImmutable(const std::string& name)
{
  auto property = std::find_if(m_propsInfo.begin(), m_propsInfo.end(),
                               [&name](const auto& prop) { return prop->name == name; });

  if (property == m_propsInfo.end())
    return {};

  return static_cast<bool>(drm_property_type_is(property->get(), DRM_MODE_PROP_IMMUTABLE));
}


Review comment (suggestion):
```suggestion
std::optional<bool> CDRMObject::IsPropertyImmutable(std::string_view name)
```

Code after:
{
  auto property = std::find_if(m_propsInfo.begin(), m_propsInfo.end(),
                               [&name](const auto& prop) { return prop->name == name; });

  if (property != m_propsInfo.end())
  {
    int ret = drmModeObjectSetProperty(m_fd, m_id, m_type, property->get()->prop_id, value);
    if (ret == 0)
      return true;
  }

  return false;
}

bool CDRMObject::SupportsProperty(const std::string& name)
{
  auto property = std::find_if(m_propsInfo.begin(), m_propsInfo.end(),
                               [&name](const auto& prop) { return prop->name == name; });

  if (property != m_propsInfo.end())
    return true;

  return false;
}

std::optional<bool> CDRMObject::IsPropertyImmutable(std::string_view name)
{
  auto property = std::find_if(m_propsInfo.begin(), m_propsInfo.end(),
                               [&name](const auto& prop) { return prop->name == name; });

  if (property == m_propsInfo.end())
    return {};

  return static_cast<bool>(drm_property_type_is(property->get(), DRM_MODE_PROP_IMMUTABLE));
}
Repository: xbmc/xbmc
File: xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.cpp (C++)

Code before:
  dts = DVD_NOPTS_VALUE;
  iFlags = 0;
  iRepeatPicture = 0;
  iDuration = 0;
  iFrameType = 0;
  color_space = AVCOL_SPC_UNSPECIFIED;
  color_range = 0;
  chroma_position = AVCHROMA_LOC_UNSPECIFIED;
  color_primaries = AVColorPrimaries::AVCOL_PRI_UNSPECIFIED;
  color_transfer = AVCOL_TRC_UNSPECIFIED;
  colorBits = 8;
  stereoMode.clear();

  qp_table = nullptr;
  qstride = 0;
  qscale_type = 0;
  pict_type = 0;

  hdrType = StreamHdrType::HDR_TYPE_NONE;

  hasDisplayMetadata = false;
  hasLightMetadata = false;

  iWidth = 0;
  iHeight = 0;
  iXOffset = 0;
  iYOffset = 0;
  iDisplayWidth = 0;
  iDisplayHeight = 0;
}

VideoPicture& VideoPicture::CopyRef(const VideoPicture &pic)
{
  if (videoBuffer)
    videoBuffer->Release();
  *this = pic;
  if (videoBuffer)
    videoBuffer->Acquire();
  return *this;
}

VideoPicture& VideoPicture::SetParams(const VideoPicture &pic)
{
  if (videoBuffer)
    videoBuffer->Release();
  *this = pic;
  videoBuffer = nullptr;
  return *this;
}

VideoPicture::VideoPicture(VideoPicture const&) = default;

Review comment (suggestion):
Please try to avoid Hungarian notation as per our code guidelines (xOffset and yOffset would suffice) 

Code after:
  dts = DVD_NOPTS_VALUE;
  iFlags = 0;
  iRepeatPicture = 0;
  iDuration = 0;
  iFrameType = 0;
  color_space = AVCOL_SPC_UNSPECIFIED;
  color_range = 0;
  chroma_position = AVCHROMA_LOC_UNSPECIFIED;
  color_primaries = AVColorPrimaries::AVCOL_PRI_UNSPECIFIED;
  color_transfer = AVCOL_TRC_UNSPECIFIED;
  colorBits = 8;
  stereoMode.clear();

  qp_table = nullptr;
  qstride = 0;
  qscale_type = 0;
  pict_type = 0;

  hdrType = StreamHdrType::HDR_TYPE_NONE;

  hasDisplayMetadata = false;
  hasLightMetadata = false;

  iWidth = 0;
  iHeight = 0;
  m_xOffset = 0;
  m_yOffset = 0;
  iDisplayWidth = 0;
  iDisplayHeight = 0;
}

VideoPicture& VideoPicture::CopyRef(const VideoPicture &pic)
{
  if (videoBuffer)
    videoBuffer->Release();
  *this = pic;
  if (videoBuffer)
    videoBuffer->Acquire();
  return *this;
}

VideoPicture& VideoPicture::SetParams(const VideoPicture &pic)
{
  if (videoBuffer)
    videoBuffer->Release();
  *this = pic;
  videoBuffer = nullptr;
  return *this;
}

VideoPicture::VideoPicture(VideoPicture const&) = default;