You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Experimental: Adding more QImage clean-up logging, to track buffer addresses
This commit is contained in:
@@ -1358,9 +1358,11 @@ void FFmpegReader::ProcessVideoPacket(int64_t requested_frame) {
|
||||
// Add Image data to frame
|
||||
if (!ffmpeg_has_alpha(AV_GET_CODEC_PIXEL_FORMAT(pStream, pCodecCtx))) {
|
||||
// Add image with no alpha channel, Speed optimization
|
||||
std::cout << "FFmpegReader::ProcessVideoPacket (A AddImage for frame: " << f->number << ", buffer: " << ( void * )&buffer[0] << ")" << std::endl;
|
||||
f->AddImage(width, height, bytes_per_pixel, QImage::Format_RGBA8888_Premultiplied, buffer);
|
||||
} else {
|
||||
// Add image with alpha channel (this will be converted to premultipled when needed, but is slower)
|
||||
std::cout << "FFmpegReader::ProcessVideoPacket (B AddImage for frame: " << f->number << ", buffer: " << ( void * )&buffer[0] << ")" << std::endl;
|
||||
f->AddImage(width, height, bytes_per_pixel, QImage::Format_RGBA8888, buffer);
|
||||
}
|
||||
|
||||
|
||||
@@ -763,6 +763,7 @@ void Frame::AddImage(
|
||||
(QImageCleanupFunction) &openshot::cleanUpBuffer,
|
||||
(void*) pixels_
|
||||
);
|
||||
std::cout << "Frame::AddImage, number: " << number << ", Cleanup buffer: " << ( void * )&pixels_[0] << ", width: " << new_width << ", height: " << new_height << std::endl;
|
||||
AddImage(new_image);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,14 +29,14 @@ namespace openshot {
|
||||
// Clean up buffer after QImage is deleted
|
||||
static inline void cleanUpBuffer(void *info)
|
||||
{
|
||||
std::cout << "--> cleanUpBuffer, info: " << info << std::endl;
|
||||
std::cout << "--> cleanUpBuffer" << std::endl;
|
||||
if (!info)
|
||||
return;
|
||||
// Remove buffer since QImage tells us to
|
||||
std::cout << "--> reinterpret cast, info: " << info << std::endl;
|
||||
auto* qbuffer = reinterpret_cast<unsigned char*>(info);
|
||||
std::cout << "--> delete pointer, info: " << info << std::endl;
|
||||
//delete[] qbuffer;
|
||||
std::cout << "--> reinterpret cast" << std::endl;
|
||||
uint8_t *qbuffer = reinterpret_cast<uint8_t *>(info);
|
||||
std::cout << "--> delete pointer, buffer: " << ( void * )&qbuffer[0] << std::endl;
|
||||
delete[] qbuffer;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user