Skip to content

Commit 95aa721

Browse files
committed
video_frame_pool: use logger + add noexcept(false)
- use logger for the e.what() - get_frame() - mark as noexcept(false) (allowed to throw exceptions)
1 parent 4986990 commit 95aa721

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/utils/video_frame_pool.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author Martin Pulec <[email protected]>
44
*/
55
/*
6-
* Copyright (c) 2020-2024 CESNET
6+
* Copyright (c) 2020-2025 CESNET, zájmoveé sdružení právnických osob
77
* All rights reserved.
88
*
99
* Redistribution and use in source and binary forms, with or without
@@ -51,9 +51,12 @@
5151
#include <stdexcept>
5252
#include <utility>
5353

54+
#include "debug.h" // for MSG
5455
#include "video_codec.h"
5556
#include "video_frame.h"
5657

58+
#define MOD_NAME "[video_frame_pool] "
59+
5760
struct video_frame_pool::impl {
5861
public:
5962
explicit impl(
@@ -183,7 +186,7 @@ std::shared_ptr<video_frame> video_frame_pool::impl::get_frame() {
183186
ret->tiles[i].data_len = m_max_data_len;
184187
}
185188
} catch (std::exception &e) {
186-
std::cerr << e.what() << std::endl;
189+
MSG(ERROR, "%s\n", e.what());
187190
deallocate_frame(ret);
188191
throw;
189192
}

src/utils/video_frame_pool.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author Martin Pulec <[email protected]>
44
*/
55
/*
6-
* Copyright (c) 2014-2024 CESNET
6+
* Copyright (c) 2020-2025 CESNET, zájmoveé sdružení právnických osob
77
* All rights reserved.
88
*
99
* Redistribution and use in source and binary forms, with or without
@@ -82,7 +82,7 @@ struct video_frame_pool {
8282
* If the pool size is exhausted (see constructor param),
8383
* the call will block until there is some available.
8484
*/
85-
std::shared_ptr<video_frame> get_frame();
85+
std::shared_ptr<video_frame> get_frame() noexcept(false);
8686

8787
/** @returns legacy struct pointer with dispose callback properly set */
8888
struct video_frame *get_disposable_frame();

0 commit comments

Comments
 (0)