TODO: change releaseAppleImage to a parameter of NotifyCaptureScreen
| 186 | |
| 187 | // TODO: change releaseAppleImage to a parameter of NotifyCaptureScreen |
| 188 | void PlayerNotifier::NotifyCaptureScreen(uint8_t *buffer, int width, int height) |
| 189 | { |
| 190 | if (!mEnable || mListener.CaptureScreen == nullptr) { |
| 191 | return; |
| 192 | } |
| 193 | |
| 194 | if (width == -1 && height == -1) { |
| 195 | auto *event = new player_event(width, height, buffer, mListener.CaptureScreen, false, releaseAppleImage); |
| 196 | pushEvent(event); |
| 197 | return; |
| 198 | } |
| 199 | auto *dupBuffer = static_cast<uint8_t *>(malloc(width * height * 4)); |
| 200 | memcpy(dupBuffer, buffer, width * height * 4); |
| 201 | auto *event = new player_event(width, height, dupBuffer, mListener.CaptureScreen, false); |
| 202 | pushEvent(event); |
| 203 | } |
| 204 | |
| 205 | void PlayerNotifier::NotifyPosition(int64_t pos) |
| 206 | { |