diff options
Diffstat (limited to 'Swiften/ScreenSharing/ReferencePictureSelection.h')
-rw-r--r-- | Swiften/ScreenSharing/ReferencePictureSelection.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/Swiften/ScreenSharing/ReferencePictureSelection.h b/Swiften/ScreenSharing/ReferencePictureSelection.h new file mode 100644 index 0000000..ff2f4c0 --- /dev/null +++ b/Swiften/ScreenSharing/ReferencePictureSelection.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * This file defines classes for doing reference picture selection, primarily + * with VP8. + */ + +/* Modified by Yoann Blein, 2012 (remove time handling for simplicity) + */ + +#pragma once + +#include <stdint.h> + +namespace Swift { + class ReferencePictureSelection { + public: + ReferencePictureSelection(); + + // Report a received reference picture selection indication. This will + // introduce a new established reference if the received RPSI isn't too late. + void ReceivedRPSI(int rpsi_picture_id); + + // Report a received slice loss indication. Returns true if a refresh frame + // must be sent to the receiver, which is accomplished by only predicting + // from the established reference. + // |now_ts| is the RTP timestamp corresponding to the current time. Typically + // the capture timestamp of the frame currently being processed. + // Returns true if it's time to encode a decoder refresh, otherwise false. + void ReceivedSLI(); + + // Returns the recommended VP8 encode flags needed. May refresh the decoder + // and/or update the reference buffers. + // |picture_id| picture id of the frame to be encoded. + // |send_refresh| should be set to true if a decoder refresh should be + // encoded, otherwise false. + // |now_ts| is the RTP timestamp corresponding to the current time. Typically + // the capture timestamp of the frame currently being processed. + // Returns the flags to be given to the libvpx encoder when encoding the next + // frame. + int EncodeFlags(int picture_id); + + // Notify the RPS that the frame with picture id |picture_id| was encoded as + // a key frame, effectively updating all reference buffers. + void refFrameSent(int picture_id); + + private: + bool update_golden_next_; + bool established_golden_; + bool received_ack_; + int last_sent_ref_picture_id_; + int established_ref_picture_id_; + bool send_refresh; + }; +} |