summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordknn <yoann.blein@free.fr>2012-07-14 08:00:24 (GMT)
committerdknn <yoann.blein@free.fr>2012-09-22 09:01:48 (GMT)
commit51958a50e31b483aa932aac8d696b229ba66b5cb (patch)
tree559c19451c2d53a1ee72113154aa187060680f3c /Swiften/ScreenSharing/VP8Encoder.cpp
parentce9a3d75677f08af0a226bb3d2bf02c28c938c33 (diff)
downloadswift-contrib-51958a50e31b483aa932aac8d696b229ba66b5cb.zip
swift-contrib-51958a50e31b483aa932aac8d696b229ba66b5cb.tar.bz2
Fixes to make classes working together
Diffstat (limited to 'Swiften/ScreenSharing/VP8Encoder.cpp')
-rw-r--r--Swiften/ScreenSharing/VP8Encoder.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/Swiften/ScreenSharing/VP8Encoder.cpp b/Swiften/ScreenSharing/VP8Encoder.cpp
index ed4d3de..7a88418 100644
--- a/Swiften/ScreenSharing/VP8Encoder.cpp
+++ b/Swiften/ScreenSharing/VP8Encoder.cpp
@@ -20,9 +20,9 @@ VP8Encoder::VP8Encoder(VP8RTPPacketizer* packetizer, unsigned int width, unsign
// Populate encoder configuration
vpx_codec_err_t err = vpx_codec_enc_config_default(codecInterface, &codecConfig, 0);
if (err) {
- SWIFT_LOG(debug) << "VP8 Encoder: Failed to get config, " << vpx_codec_err_to_string(err) << std::endl;
+ SWIFT_LOG(error) << "VP8 Encoder: Failed to get config, " << vpx_codec_err_to_string(err) << std::endl;
// TODO: exception
}
// Update the default configuration with our settings
@@ -49,31 +49,31 @@ void VP8Encoder::updateCodecConfig()
vpx_img_free(imageBuffer);
vpx_codec_err_t err = vpx_codec_enc_init(&codecContext, codecInterface, &codecConfig, codecFlags);
if (err) {
- SWIFT_LOG(debug) << "VP8 Encoder: Failed to initialize encoder, " << vpx_codec_err_to_string(err) << std::endl;
+ SWIFT_LOG(error) << "VP8 Encoder: Failed to initialize encoder, " << vpx_codec_err_to_string(err) << std::endl;
// TODO: exception
return;
}
imageBuffer = vpx_img_alloc(0, VPX_IMG_FMT_YV12, codecConfig.g_w, codecConfig.g_h, 1);
if (!imageBuffer) {
- SWIFT_LOG(debug) << "VP8 Encoder: Failed to allocate image" << std::endl;
+ SWIFT_LOG(error) << "VP8 Encoder: Failed to allocate image" << std::endl;
// TODO: exception
}
}
-void VP8Encoder::encodeImage(const Image &frame)
+void VP8Encoder::encodeImage(const Image& frame)
{
if (!convertRGB24toYV12inBuffer(frame)) {
- SWIFT_LOG(debug) << "VP8 Encoder: Failed to convert frame: Image buffer not initialized" << std::endl;
+ SWIFT_LOG(error) << "VP8 Encoder: Failed to convert frame: Image buffer not initialized" << std::endl;
// TODO: exception ?
return;
}
vpx_codec_err_t err = vpx_codec_encode(&codecContext, imageBuffer, frameNumber, 1, frameFlags, VPX_DL_REALTIME);
if (err) {
- SWIFT_LOG(debug) << "VP8 Encoder: Failed to encode frame, " << vpx_codec_err_to_string(err) << std::endl;
+ SWIFT_LOG(error) << "VP8 Encoder: Failed to encode frame, " << vpx_codec_err_to_string(err) << std::endl;
// TODO: exception ?
return;
}
@@ -91,9 +91,9 @@ void VP8Encoder::encodeImage(const Image &frame)
++frameNumber;
}
-bool VP8Encoder::convertRGB24toYV12inBuffer(const Image &frame)
+bool VP8Encoder::convertRGB24toYV12inBuffer(const Image& frame)
{
if (!imageBuffer)
return false;
@@ -103,9 +103,9 @@ bool VP8Encoder::convertRGB24toYV12inBuffer(const Image &frame)
unsigned int width = frame.width;
unsigned int height = frame.height;
unsigned int len = width * height;
- const std::vector<uint8_t> &data = frame.data;
+ const std::vector<uint8_t>& data = frame.data;
for (unsigned int i = 0; i < len; ++i) {
const uint8_t* p = &data[3 * i];
yPlane[i] = ((66 * p[0] + 129 * p[1] + 25 * p[2] + 128) >> 8) + 16;