[Reform] Apply Coding Style
authorreview-bot <reviewbot@samsung.com>
Wed, 27 Sep 2023 05:04:51 +0000 (14:04 +0900)
committerreview-bot <reviewbot@samsung.com>
Wed, 27 Sep 2023 05:04:51 +0000 (14:04 +0900)
12 files changed:
include/esplusplayer/types/buffer.h
include/esplusplayer_capi/buffer.h
include/esplusplayer_capi/espacket.h
include/esplusplayer_capi/esplusplayer_capi.h
src/esplusplayer/include_internal/esplayer/decoded_pkt_list.h
src/esplusplayer/include_internal/esplayer/esplayer.h
src/esplusplayer/src/esplayer.cpp
src/esplusplayer/src/esplusplayer_capi.cpp
src/plusplayer-core/include_internal/core/decoderinputbuffer.h
src/plusplayer-core/src/plusplayer_cfg.cpp
ut/src/tc_regression.cpp
ut/src/utils/utility.cpp

index 3edc5e4..7b8abfa 100644 (file)
@@ -65,10 +65,10 @@ struct DecodedVideoPacket {
 #endif
 };
 
-struct DecoderBufferTime{
+struct DecoderBufferTime {
   uint64_t pts = 0;
   uint64_t system_time = 0;
-} ;
+};
 
 /**
  * @brief Enumerations for the state of getting decoded packet
index 4c38b64..039e845 100644 (file)
@@ -47,7 +47,7 @@ enum esplusplayer_buffer_status {
  * ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_SCALE:
  * decoded video frame will be croped and scaled, then sent to
  * user by media_packet_video_decoded_cb, only support hw decoder now
-*/
+ */
 enum esplusplayer_decoded_video_frame_buffer_type {
   ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_NONE,
   ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_COPY,
@@ -107,7 +107,8 @@ typedef struct {
    */
   uint64_t pts;
   /**
-   * @description   system time of decoder input or output buffer, in millisecond
+   * @description   system time of decoder input or output buffer, in
+   * millisecond
    */
   uint64_t system_time;
 } esplusplayer_decoder_buffer_time;
index a223821..dd09982 100644 (file)
@@ -26,7 +26,6 @@
 #ifndef __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_ESPACKET_H__
 #define __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_ESPACKET_H__
 
-
 #include "esplusplayer_capi/matroska_color.h"
 #include "esplusplayer_capi/stream.h"
 
index 7f53e33..4d7165d 100644 (file)
@@ -3937,18 +3937,18 @@ int esplusplayer_get_video_stream_rotation_info(
 int esplusplayer_set_simple_mix_out_buffer_level(
     esplusplayer_handle handle, esplusplayer_simple_mix_out_buffer_level level);
 
-
 #ifdef TIZEN_FEATURE_PUBLIC
 /**
  * @brief     Provided api for enabling video hole.
  * @param     [in] handle : esplusplayer handle.
  * @param     [in] value : the value of video hole.
  *            (@c true = video hole enabled, @c false = video hole disabled)
- * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success, otherwise @c one of esplusplayer_error_type
- *            values will be returned.
+ * @return    @c ESPLUSPLAYER_ERROR_TYPE_NONE on success, otherwise @c one of
+ * esplusplayer_error_type values will be returned.
  * @retval    #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
  * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
- * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation failed
+ * @retval    #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
+ * failed
  * @code
  *            esplusplayer_open(esplayer);
  *            esplusplayer_enable_video_hole(esplayer, false);
@@ -3956,15 +3956,17 @@ int esplusplayer_set_simple_mix_out_buffer_level(
  *            esplusplayer_close(esplayer);
  * @endcode
  * @pre       The player state must not be #ESPLUSPLAYER_STATE_NONE.
- * @remark    To disable video hole, esplusplayer_decoded_video_frame_buffer_type() must
- *            not be set to #ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_NONE.
- *            To enable video hole, esplusplayer_set_display() must be set to #ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY
+ * @remark    To disable video hole,
+ * esplusplayer_decoded_video_frame_buffer_type() must not be set to
+ * #ESPLUSPLAYER_DECODED_VIDEO_FRAME_BUFFER_TYPE_NONE. To enable video hole,
+ * esplusplayer_set_display() must be set to #ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY
  * @post      None
  * @exception None
  * @see       esplusplayer_set_video_frame_buffer_type()
  *            esplusplayer_set_media_packet_video_decoded_cb()
  */
-int esplusplayer_enable_video_hole(esplusplayer_handle handle, const bool value);
+int esplusplayer_enable_video_hole(esplusplayer_handle handle,
+                                   const bool value);
 #endif
 #ifdef __cplusplus
 }
index 58b4eb2..8f0b2d6 100644 (file)
@@ -25,8 +25,8 @@ void DecodedPacketDeleter(esplusplayer_decoded_video_packet* packet) {
   if (packet == nullptr || packet->surface_data == nullptr) return;
 #else
   if (packet == nullptr) return;
-  if (packet->private_data) { // hw dec
-    gst_buffer_unref((GstBuffer *)packet->private_data);
+  if (packet->private_data) {  // hw dec
+    gst_buffer_unref((GstBuffer*)packet->private_data);
     packet->private_data = nullptr;
   }
   if (packet->surface_data == nullptr) return;
@@ -34,7 +34,7 @@ void DecodedPacketDeleter(esplusplayer_decoded_video_packet* packet) {
   // LOG_DEBUG("packet[%p] deleted", packet);
   tbm_surface_destroy(static_cast<tbm_surface_h>(packet->surface_data));
   packet->surface_data = NULL;
-// LCOV_EXCL_STOP
+  // LCOV_EXCL_STOP
 }
 }  // namespace
 
@@ -174,7 +174,7 @@ class DecodedScaledPacketList : public AbstractDecodedPacketList {
  public:
   explicit DecodedScaledPacketList() { LOG_DEBUG("created"); }
   virtual ~DecodedScaledPacketList() { LOG_DEBUG("destroyed"); }
-// LCOV_EXCL_START
+  // LCOV_EXCL_START
   virtual void GetFreeTbmSurface(void** ptr, bool is_scale_change) {
     std::unique_lock<std::mutex> lk(mtx_);
     if (is_scale_change) {
@@ -265,7 +265,7 @@ class DecodedScaledPacketList : public AbstractDecodedPacketList {
       return false;
     });
   }
-// LCOV_EXCL_STOP
+  // LCOV_EXCL_STOP
 
   virtual void Clear() override {
     std::unique_lock<std::mutex> lk(mtx_);
@@ -280,7 +280,7 @@ class DecodedScaledPacketList : public AbstractDecodedPacketList {
   }
 
  protected:
-// LCOV_EXCL_START
+  // LCOV_EXCL_START
   virtual bool IsAvailableInternal() override {
     if (GetList().size() > kMaxAvailableSize_) return false;
     return true;
@@ -305,7 +305,7 @@ class DecodedScaledPacketList : public AbstractDecodedPacketList {
       }
     }
   }
-// LCOV_EXCL_STOP
+  // LCOV_EXCL_STOP
 
  private:
   const std::uint32_t kMaxAvailableSize_ = 5;
index 67e7c88..86895fb 100644 (file)
@@ -23,7 +23,7 @@
 #ifdef USE_MIXER
 #include "mixer/mixerticket.h"
 #include "mixer/mixerticket_eventlistener.h"
-#endif // USE_MIXER
+#endif  // USE_MIXER
 #include "esplayer/espacket_logger.h"
 #include "esplayer/message.hpp"
 #include "esplayer/state_manager.hpp"
@@ -71,7 +71,7 @@ class EsPlayer : public EsPlusPlayer {
   bool SetDisplay(const DisplayType& type, void* obj) override;
 #ifdef USE_MIXER
   bool SetDisplay(const DisplayType& type, MixerTicket* handle) override;
-#endif // USE_MIXER
+#endif  // USE_MIXER
   bool SetDisplay(const DisplayType& type, void* ecore_wl2_window, const int x,
                   const int y, const int w, const int h) override;
   bool SetDisplaySubsurface(const DisplayType& type, void* ecore_wl2_subsurface,
@@ -221,7 +221,7 @@ class EsPlayer : public EsPlusPlayer {
 #endif
 #ifdef USE_MIXER
   bool PrepareVideoMixingMode_(std::vector<Track>* tracks);
-#endif // USE_MIXER
+#endif  // USE_MIXER
   void InitValuesFromIni_();
 
  private:  // private types
@@ -253,7 +253,7 @@ class EsPlayer : public EsPlusPlayer {
 #ifdef USE_MIXER
     void OnMediaPacketVideoRawDecoded(
         const DecodedVideoRawModePacket& packet) override;
-#endif // USE_MIXER
+#endif  // USE_MIXER
 
    private:
     void ReadyToPrepare_(const TrackType& type);
@@ -283,7 +283,7 @@ class EsPlayer : public EsPlusPlayer {
    private:
     EsPlayer* handler_{nullptr};
   };
-#endif // USE_MIXER
+#endif  // USE_MIXER
 
 #ifdef TIZEN_FEATURE_PUBLIC
   bool EnableVideoHole(bool value) override;
@@ -329,7 +329,7 @@ class EsPlayer : public EsPlusPlayer {
       new TrackRendererEventListener(this)};
 #ifdef USE_MIXER
   std::unique_ptr<MixerListener> mixer_event_listener_{new MixerListener(this)};
-#endif // USE_MIXER
+#endif  // USE_MIXER
   std::unique_ptr<TrackRendererAdapter> trackrenderer_;
   std::future<void> preparetask_;
   PlayerAppInfo app_info_;
@@ -350,7 +350,7 @@ class EsPlayer : public EsPlusPlayer {
   std::mutex audio_focus_m_;
   bool enable_audio_pipeline_handle_ = true;
   bool enable_rsc_alloc_handle_ = true;
-#endif // USE_MIXER
+#endif  // USE_MIXER
   DecodedVideoFrameBufferType vidoe_frame_buffer_type_ =
       DecodedVideoFrameBufferType::kNone;
   // for debugging
index b5f0997..18ffd5e 100644 (file)
@@ -387,7 +387,7 @@ bool EsPlayer::Deactivate(const StreamType type) {
         this, "can't deactivate audio stream, mixer will control audio stream");
     return false;
   }
-#endif // USE_MIXER
+#endif  // USE_MIXER
   if (!trackrenderer_->Deactivate(static_cast<TrackType>(type))) {
     return false;
   }
@@ -425,7 +425,7 @@ bool EsPlayer::Activate(const StreamType type) {
                 "can't activate audio stream, mixer will control audio stream");
     return false;
   }
-#endif // USE_MIXER
+#endif  // USE_MIXER
   if (!track_.empty()) {
     auto has_track = [type](const Track& item) -> bool {
       return item.type == static_cast<TrackType>(type);
@@ -453,7 +453,7 @@ bool EsPlayer::Activate(const StreamType type) {
         trackrenderer_->SetVideoFrameBufferType(
             VideoFrameTypeStrategyPtr(new RawVideoFrameTypeStrategy()));
       else
-#endif // USE_MIXER
+#endif  // USE_MIXER
         trackrenderer_->SetVideoFrameBufferType(VideoFrameTypeStrategyPtr(
             new DefaultVideoFrameTypeStrategy(vidoe_frame_buffer_type_)));
     }
@@ -481,7 +481,7 @@ bool EsPlayer::DeactivateAudio() {
         this, "can't deactivate audio stream, mixer will control audio stream");
     return false;
   }
-#endif // USE_MIXER
+#endif  // USE_MIXER
   if (!trackrenderer_->DeactivateAudio()) {
     return false;
   }
@@ -503,7 +503,7 @@ bool EsPlayer::ActivateAudio() {
                 "can't activate audio stream, mixer will control audio stream");
     return false;
   }
-#endif // USE_MIXER
+#endif  // USE_MIXER
   if (track_.empty()) {
     return false;
   }
@@ -545,7 +545,7 @@ bool EsPlayer::Stop() {
     ResetContextForStop_();
 #ifdef USE_MIXER
     if (mixer_ticket_) mixer_ticket_.reset();
-#endif // USE_MIXER
+#endif  // USE_MIXER
     performance_checker::End(start, "Stop");
     return true;
   };
@@ -662,7 +662,7 @@ bool EsPlayer::PrepareVideoMixingMode_(std::vector<Track>* tracks) {
   }
   return true;
 }
-#endif // USE_MIXER
+#endif  // USE_MIXER
 // LCOV_EXCL_START
 
 bool EsPlayer::Prepare_() {
@@ -705,7 +705,7 @@ bool EsPlayer::Prepare_() {
         }
       }
     }
-#endif // USE_MIXER
+#endif  // USE_MIXER
     for (const auto& track : active_track) {
       switch (track.type) {
         case kTrackTypeAudio: {
@@ -963,7 +963,7 @@ bool EsPlayer::SetDisplay(const DisplayType& type, void* obj) {
   }
 #ifdef USE_MIXER
   if (mixer_ticket_) mixer_ticket_.reset();
-#endif // USE_MIXER
+#endif  // USE_MIXER
   return trackrenderer_->SetDisplay(type, obj);
 }
 
@@ -981,7 +981,7 @@ bool EsPlayer::SetDisplay(const DisplayType& type, MixerTicket* handle) {
   }
   return true;
 }
-#endif // USE_MIXER
+#endif  // USE_MIXER
 
 bool EsPlayer::SetDisplay(const DisplayType& type, void* ecore_wl2_window,
                           const int x, const int y, const int w, const int h) {
@@ -992,7 +992,7 @@ bool EsPlayer::SetDisplay(const DisplayType& type, void* ecore_wl2_window,
   }
 #ifdef USE_MIXER
   if (mixer_ticket_) mixer_ticket_.reset();
-#endif // USE_MIXER
+#endif  // USE_MIXER
   return trackrenderer_->SetDisplay(type, ecore_wl2_window, x, y, w, h);
 }
 
@@ -1006,7 +1006,7 @@ bool EsPlayer::SetDisplaySubsurface(const DisplayType& type,
   }
 #ifdef USE_MIXER
   if (mixer_ticket_) mixer_ticket_.reset();
-#endif // USE_MIXER
+#endif  // USE_MIXER
   return trackrenderer_->SetDisplaySubsurface(type, ecore_wl2_subsurface, x, y,
                                               w, h);
 }
@@ -1020,7 +1020,7 @@ bool EsPlayer::SetDisplay(const DisplayType& type, unsigned int surface_id,
   }
 #ifdef USE_MIXER
   if (mixer_ticket_) mixer_ticket_.reset();
-#endif // USE_MIXER
+#endif  // USE_MIXER
   return trackrenderer_->SetDisplay(type, surface_id, x, y, w, h);
 }
 // LCOV_EXCL_START
@@ -1054,7 +1054,7 @@ bool EsPlayer::SetDisplayRoi(const Geometry& roi) {
 #ifdef USE_MIXER
   mixerticket_roi_ = roi;
   if (mixer_ticket_) return true;
-#endif // USE_MIXER
+#endif  // USE_MIXER
   return trackrenderer_->SetDisplayRoi(roi);
 }
 
@@ -1110,7 +1110,7 @@ bool EsPlayer::SetDisplayVisible(bool is_visible) {
     is_visible_ = is_visible;
     return true;
   }
-#endif // USE_MIXER
+#endif  // USE_MIXER
   return trackrenderer_->SetDisplayVisible(is_visible);
 }
 
@@ -2086,7 +2086,7 @@ bool EsPlayer::SetVideoCodecType(const PlayerVideoCodecType& type) {
     video_decoding_mode_ = internal::kNdecodingMode;
     return true;
   }
-#endif // USE_MIXER
+#endif  // USE_MIXER
   LOG_INFO_P(this, "PlayerVideoCodecType [%s]",
              (type == kPlayerVideoCodecTypeHW) ? "hardware" : "software");
   video_codec_type_ = type;
@@ -2174,7 +2174,7 @@ bool EsPlayer::SetAlternativeVideoResource(unsigned int rsc_type) {
     LOG_ERROR_P(this, "player can't control resource type, mixer will do it");
     return false;
   }
-#endif // USE_MIXER
+#endif  // USE_MIXER
   if (resource_alloc_policy_ > RscAllocPolicy::kRscAllocExclusive) {
     LOG_ERROR_P(this,
                 "has set resource allocate policy, the alternative "
@@ -2717,7 +2717,7 @@ bool EsPlayer::MixerListener::OnUpdateDisplayInfo(const DisplayInfo& cur_info,
       handler_->is_visible_ ? VisibleStatus::kVisible : VisibleStatus::kHide;
   return true;
 }
-#endif // USE_MIXER
+#endif  // USE_MIXER
 // LCOV_EXCL_STOP
 
 void EsPlayer::TrackRendererEventListener::OnSeekData(const TrackType& type,
index 0a2fc6f..6179be2 100644 (file)
@@ -20,7 +20,7 @@ using esplusplayer::Geometry;
 #include "esplusplayer_capi/esplusplayer_internal.h"
 #if defined(USE_MIXER) && !defined(IS_TOMATO)
 #include "mixer_capi/mixer_capi.h"
-#endif // defined(USE_MIXER) && !defined(IS_TOMATO)
+#endif  // defined(USE_MIXER) && !defined(IS_TOMATO)
 #include "esplusplayer/appinfo.h"
 #include "esplusplayer/audioeasinginfo.h"
 #include "esplusplayer/drm.h"
@@ -1071,7 +1071,7 @@ int esplusplayer_set_display(esplusplayer_handle handle,
     return convert_return_type_(
         cast_(handle)->SetDisplay(static_cast<DisplayType>(type), ticket));
   }
-#endif // defined(USE_MIXER) && !defined(IS_TOMATO)
+#endif  // defined(USE_MIXER) && !defined(IS_TOMATO)
   return convert_return_type_(
       cast_(handle)->SetDisplay(static_cast<DisplayType>(type), window));
 }
@@ -2433,7 +2433,8 @@ int esplusplayer_set_simple_mix_out_buffer_level(
 }
 
 #ifdef TIZEN_FEATURE_PUBLIC
-int esplusplayer_enable_video_hole(esplusplayer_handle handle, const bool value) {
+int esplusplayer_enable_video_hole(esplusplayer_handle handle,
+                                   const bool value) {
   LOG_ENTER_P(cast_(handle))
   if (is_null_(handle)) return ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER;
 
index 53c8e0e..69b17d3 100644 (file)
@@ -12,7 +12,8 @@
 
 #include "gst/gst.h"
 // temporary until drmdecrypt platform interfaces are added into rootstrap
-#if !defined(TIZEN_FEATURE_PUBLIC) && !defined(PLUPLAYER_DOWNLOADABLE_APP_TVPLUS)
+#if !defined(TIZEN_FEATURE_PUBLIC) && \
+    !defined(PLUPLAYER_DOWNLOADABLE_APP_TVPLUS)
 #include <drmdecrypt/drmdecrypt_api.h>
 #endif
 
@@ -86,7 +87,8 @@ class DecoderInputBuffer : private boost::noncopyable {
   }
 
   void ReleaseTZHandle_(GstBuffer* buffer) {
-#if !defined(TIZEN_FEATURE_PUBLIC) && !defined(PLUPLAYER_DOWNLOADABLE_APP_TVPLUS)
+#if !defined(TIZEN_FEATURE_PUBLIC) && \
+    !defined(PLUPLAYER_DOWNLOADABLE_APP_TVPLUS)
     GstStructure* tzqdata = GST_STRUCTURE(gst_mini_object_get_qdata(
         GST_MINI_OBJECT(buffer),
         g_quark_from_static_string("GstTzHandleData")));
index 1a86b9f..6e835fb 100644 (file)
 namespace esplusplayer {
 
 namespace esplusplayer_cfg {
-  
+
 const char* GetIniPath() {
   const char* path =
-    tzplatform_mkpath(TZ_SYS_RO_ETC, "multimedia/esplusplayer.ini");
+      tzplatform_mkpath(TZ_SYS_RO_ETC, "multimedia/esplusplayer.ini");
   assert(path);
   return path;
 }
 
-} // namespace esplusplayer_cfg
+}  // namespace esplusplayer_cfg
 
-} // namespace esplusplayer
\ No newline at end of file
+}  // namespace esplusplayer
\ No newline at end of file
index 1f88872..d3475f6 100644 (file)
@@ -36,7 +36,7 @@ class Context {
     std::unique_ptr<EsStreamReader> reader = nullptr;
     bool ready_to_push = false;
 
-    explicit StreamContext(const std::string &path,
+    explicit StreamContext(const std::stringpath,
                            esplusplayer_stream_type type) noexcept {
       reader = std::make_unique<EsStreamReader>(path, type);
     }
@@ -115,7 +115,7 @@ class Context {
     return prepared_.result;
   }
 
-  bool SetDisplay(void *window) {
+  bool SetDisplay(voidwindow) {
     return esplusplayer_set_display(handle_, ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,
                                     window) == ESPLUSPLAYER_ERROR_TYPE_NONE;
   }
@@ -140,7 +140,7 @@ class Context {
   }
 
  public:
-  static Context *Create(const std::string &path) {
+  static Context* Create(const std::string& path) {
     if (path.empty()) {
       return nullptr;
     }
@@ -155,7 +155,7 @@ class Context {
   }
 
  private:
-  explicit Context(const std::string &path) : path_(path) {}
+  explicit Context(const std::stringpath) : path_(path) {}
 
   bool Init() {
     video_ = std::make_unique<StreamContext>(path_ + "video/",
@@ -211,23 +211,23 @@ class Context {
   }
 
  private:
-  static void OnError(const esplusplayer_error_type, void *) {
+  static void OnError(const esplusplayer_error_type, void*) {
     std::cout << "Error happened" << std::endl;
   }
-  static void OnResourceConflicted(void *) {
+  static void OnResourceConflicted(void*) {
     std::cout << "Resource conflicted" << std::endl;
   }
-  static void OnPrepared(bool ret, void *userdata) {
+  static void OnPrepared(bool ret, voiduserdata) {
     std::cout << "Prepared" << std::endl;
-    auto *ctx = static_cast<Context *>(userdata);
+    auto* ctx = static_cast<Context*>(userdata);
     ctx->StartDataFeedingTask(ESPLUSPLAYER_STREAM_TYPE_VIDEO);
     ctx->StartDataFeedingTask(ESPLUSPLAYER_STREAM_TYPE_AUDIO);
     ctx->SignalPrepareDone(ret);
   }
   static void OnReadyToPrepare(const esplusplayer_stream_type type,
-                               void *userdata) {
+                               voiduserdata) {
     std::cout << "Ready to prepare" << std::endl;
-    auto *ctx = static_cast<Context *>(userdata);
+    auto* ctx = static_cast<Context*>(userdata);
     ctx->StartDataFeedingTask(type);
   }
 
@@ -266,8 +266,8 @@ struct ResourceManager {
   }
 
   static rm_cb_result OnResourceConflicted(int handle, rm_callback_type event,
-                                           rm_device_request_s *info,
-                                           void *data) {
+                                           rm_device_request_sinfo,
+                                           voiddata) {
     return RM_CB_RESULT_OK;
   }
 
@@ -290,10 +290,10 @@ class RegressionTest : public ::testing::Test {
   }
 
  protected:
-  static ::Environment *window_;
+  static ::Environmentwindow_;
 };
 
-::Environment *RegressionTest::window_ = nullptr;
+::EnvironmentRegressionTest::window_ = nullptr;
 
 /*
  * [[ DF230714-00327 ]]
index da03093..6ec0d71 100644 (file)
@@ -1,37 +1,38 @@
+#include "ut/include/utils/utility.h"
+
 #include <Ecore.h>
 #include <Elementary.h>
 #include <gtest/gtest.h>
+#include <jconfig.h>
+#include <jpeglib.h>
+#include <math.h>
+#include <poll.h>
+#include <unistd.h>
+
 #include <algorithm>
 #include <cassert>
 #include <chrono>
+#include <fstream>
 #include <memory>
 
-#include <unistd.h>
-#include <poll.h>
-
-#include "ut/include/utils/utility.h"
 #include "ut/include/esplusplayer/eseventlistener.hpp"
 #include "ut/include/esplusplayer/esreader.hpp"
-
-#include <math.h>
-#include <fstream>
-#include <jconfig.h>
-#include <jpeglib.h>
 #ifdef TIZEN_FEATURE_PUBLIC
 #include <system_info.h>
 #else
 #include <capi-system-info/system_info.h>
 #include <capi-system-info/system_info_key.h>
 #include <system-type/system_type_enum.h>
-#include "ivideocapture.hpp"
+
 #include "capi-video-capture.h"
-#include "iaudio-control.hpp"
 #include "diagnosis-audio-control.hpp"
+#include "iaudio-control.hpp"
+#include "ivideocapture.hpp"
 #endif
 
 using namespace std;
 using namespace esplusplayer;
-//using namespace tc;
+// using namespace tc;
 using UserData = void*;
 
 namespace utils {
@@ -125,7 +126,7 @@ esplusplayer_handle Utility::GetStartedMixESPP(std::string& uri,
     printf("esplusplayer_start failed\n");
   return nullptr;
 }
-#endif // USE_MIXER
+#endif  // USE_MIXER
 
 esplusplayer_handle Utility::GetOpenedESPP(Geometry& roi) {
   esplusplayer_handle player = esplusplayer_create();
@@ -202,7 +203,7 @@ void Utility::FeedingEsPacket(esplusplayer_handle player,
       memset(&pkt, 0, sizeof(esplusplayer_es_packet));
       if (!reader->ReadNextPacket(pkt)) break;
       esplusplayer_submit_packet(player, &pkt);
-      delete []pkt.buffer;
+      delete[] pkt.buffer;
     }
   };
   if (type == ESPLUSPLAYER_STREAM_TYPE_VIDEO) {
@@ -274,9 +275,8 @@ unsigned int Gcd(unsigned int u, unsigned int v) {
 
 #ifndef TIZEN_FEATURE_PUBLIC
 void ResizeCopy(unsigned int m_width, unsigned int m_height,
-                unsigned int m_rwidth, unsigned int m_rheight,
-                char* c_ptr, char* y_ptr, unsigned char* dest,
-                unsigned int color_format) {
+                unsigned int m_rwidth, unsigned int m_rheight, char* c_ptr,
+                char* y_ptr, unsigned char* dest, unsigned int color_format) {
   unsigned int omit = 1;
   unsigned int x = 0;
   unsigned int y = 0;
@@ -296,7 +296,6 @@ void ResizeCopy(unsigned int m_width, unsigned int m_height,
   for (y = 0; y < m_height; y++) {
     if ((y + 1) % omit || !resize) {
       for (x = 0; x < m_width; x += sizeof(unsigned int)) {
-
         unsigned int Yplain =
             *((unsigned int*)((void*)(y_ptr + y * m_width + x)));
         unsigned int Cplain =
@@ -315,13 +314,13 @@ void ResizeCopy(unsigned int m_width, unsigned int m_height,
             break;
         }
         if ((x + 4) % omit || !resize) {
-          dest[inc++] = (Yplain) & 0xFF;
+          dest[inc++] = (Yplain)&0xFF;
           dest[inc++] = Cplain & 0xFF;
           dest[inc++] = (Cplain >> 8) & 0xFF;
         }
         if ((x + 3) % omit || !resize) {
           dest[inc++] = (Yplain >> 8) & 0xFF;
-          dest[inc++] = (Cplain) & 0xFF;
+          dest[inc++] = (Cplain)&0xFF;
           dest[inc++] = (Cplain >> 8) & 0xFF;
         }
 
@@ -341,14 +340,14 @@ void ResizeCopy(unsigned int m_width, unsigned int m_height,
   }
 }
 
-int Utility::CaptureYUV(int capture_width, int capture_height,
-                        char* ybuff, char* cbuff, int ysize,
-                        int csize, std::string result_file_path) {
+int Utility::CaptureYUV(int capture_width, int capture_height, char* ybuff,
+                        char* cbuff, int ysize, int csize,
+                        std::string result_file_path) {
   // screen capture
   IVideoCapture* VCObjptr = IVideoCapture::getInstance();
 
   IVideoCapture::InputParams input_params;
-  
+
   input_params.capture_w = capture_width;
   input_params.capture_h = capture_height;
 
@@ -379,7 +378,8 @@ int Utility::CaptureYUV(int capture_width, int capture_height,
 
   return 0;
 }
-///TODO:: Modify the API to return the pointer instead of writing it as an image file.
+/// TODO:: Modify the API to return the pointer instead of writing it as an
+/// image file.
 int Utility::CaptureJPG(const int capture_width, const int capture_height,
                         char* ybuff, char* cbuff, const int ysize,
                         const int csize, std::string img_file_path) {
@@ -457,7 +457,6 @@ int Utility::CaptureJPG(const int capture_width, const int capture_height,
 }
 
 int Utility::CheckYUV(int x, int y) {
-
   /* screen capture */
   IVideoCapture* VCObjptr = IVideoCapture::getInstance();
 
@@ -466,7 +465,7 @@ int Utility::CheckYUV(int x, int y) {
   int CAPTURE_BUF_SIZE = CAPTURE_WIDTH * CAPTURE_HEIGHT;
   char ybuff[CAPTURE_BUF_SIZE] = {0};
   char cbuff[CAPTURE_BUF_SIZE] = {0};
-  
+
   IVideoCapture::InputParams input_params;
   input_params.capture_w = 640;
   input_params.capture_h = 360;
@@ -481,11 +480,12 @@ int Utility::CheckYUV(int x, int y) {
 
   VCObjptr->getVideoPostYUV(input_params, output_params);
 
-  /* check YUV value. As the capture size (640 x 360) is mapped with the full screen (1920 x 1080), the position should be resized. */
+  /* check YUV value. As the capture size (640 x 360) is mapped with the full
+   * screen (1920 x 1080), the position should be resized. */
   int new_X = x / 3;
   int new_Y = y / 3;
   int position = CAPTURE_WIDTH * (new_Y - 1) + new_X;
-  
+
   LOGE("Y value : %d", (int)ybuff[position]);
   return (int)ybuff[position];
 }
@@ -498,7 +498,8 @@ bool Utility::IsAudioDisconnected() {
 
 bool Utility::IsAudioMute() {
   long audioMute = 0;
-  EXPECT_EQ(audioDiagnoser->Diagnosis_GetBoolean(0, "main out mute", &audioMute), 0);
+  EXPECT_EQ(
+      audioDiagnoser->Diagnosis_GetBoolean(0, "main out mute", &audioMute), 0);
   return (audioMute != 0);
 }
 #endif
@@ -530,10 +531,10 @@ bool Utility::IsChipset(const char* name) {
 }
 
 std::string Utility::getKeyboardInput(int timeoutMsec) {
-  struct pollfd pfd = { STDIN_FILENO, POLLIN, 0 };
+  struct pollfd pfd = {STDIN_FILENO, POLLIN, 0};
   std::string line = "";
   int ret = poll(&pfd, 1, timeoutMsec);
-  if(ret == 1) {// there is something to read
+  if (ret == 1) {  // there is something to read
     std::getline(std::cin, line);
   }
   return line;
@@ -557,7 +558,7 @@ vector<string> Utility::Split(string in, char delimiter) {
   while (getline(ss, line)) {
     stringstream liness(line);
     string token;
-    while(getline(liness, token, delimiter)) {
+    while (getline(liness, token, delimiter)) {
       if (!token.empty()) {
         result.push_back(token);
       }