xref: /aosp_15_r20/external/webrtc/test/pc/e2e/analyzer/video/video_frame_tracking_id_injector.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1 /*
2  *  Copyright (c) 2021 The WebRTC project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #ifndef TEST_PC_E2E_ANALYZER_VIDEO_VIDEO_FRAME_TRACKING_ID_INJECTOR_H_
12 #define TEST_PC_E2E_ANALYZER_VIDEO_VIDEO_FRAME_TRACKING_ID_INJECTOR_H_
13 
14 #include <cstdint>
15 
16 #include "api/video/encoded_image.h"
17 #include "test/pc/e2e/analyzer/video/encoded_image_data_injector.h"
18 
19 namespace webrtc {
20 namespace webrtc_pc_e2e {
21 
22 // This injector sets and retrieves the provided id in the EncodedImage
23 // video_frame_tracking_id field. This is only possible with the RTP header
24 // extension VideoFrameTrackingIdExtension that will propagate the input
25 // tracking id to the received EncodedImage. This RTP header extension is
26 // enabled with the field trial WebRTC-VideoFrameTrackingIdAdvertised
27 // (http://www.webrtc.org/experiments/rtp-hdrext/video-frame-tracking-id).
28 //
29 // Note that this injector doesn't allow to discard frames.
30 class VideoFrameTrackingIdInjector : public EncodedImageDataPropagator {
31  public:
32   EncodedImage InjectData(uint16_t id,
33                           bool unused_discard,
34                           const EncodedImage& source) override;
35 
36   EncodedImageExtractionResult ExtractData(const EncodedImage& source) override;
37 
Start(int)38   void Start(int) override {}
AddParticipantInCall()39   void AddParticipantInCall() override {}
RemoveParticipantInCall()40   void RemoveParticipantInCall() override {}
41 };
42 
43 }  // namespace webrtc_pc_e2e
44 }  // namespace webrtc
45 
46 #endif  // TEST_PC_E2E_ANALYZER_VIDEO_VIDEO_FRAME_TRACKING_ID_INJECTOR_H_
47