Ocean
Loading...
Searching...
No Matches
AVFFrameMedium.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_MEDIA_AVF_FRAME_MEDIUM_H
9#define META_OCEAN_MEDIA_AVF_FRAME_MEDIUM_H
10
13
15
17
18namespace Ocean
19{
20
21namespace Media
22{
23
24namespace AVFoundation
25{
26
27/**
28 * This is the base class for all AVFoundation frame mediums.
29 * @ingroup mediaavf
30 */
32 virtual public AVFMedium,
33 virtual public FrameMedium
34{
35 protected:
36
37 /**
38 * Creates a new frame medium by a given url.
39 * @param url Url of the frame medium
40 */
41 explicit AVFFrameMedium(const std::string& url);
42
43 /**
44 * Destructs a AVFFrameMedium object
45 */
46 ~AVFFrameMedium() override;
47
48 /**
49 * Called, if a new sample arrived.
50 * @param pixelBuffer A pointer to a buffer that contains the pixel data of the sample
51 * @param anyCamera The camera profile if known; nullptr otherwise
52 * @param unixTimestamp Used to set timestamp of the Frame associated to the sample (measured in seconds since 1970-01-01 00:00 UTC)
53 * @param sampleTime The presentation time of the sample in seconds, used to set the relative timestamp of the frame associated to the sample
54 */
55 virtual void onNewSample(CVPixelBufferRef pixelBuffer, SharedAnyCamera anyCamera, const double unixTimestamp, const double sampleTime);
56
57 protected:
58
59 /// The frame type of the most recent.
61};
62
63}
64
65}
66
67}
68
69#endif // META_OCEAN_MEDIA_AVF_FRAME_MEDIUM_H
Definition of a frame type composed by the frame dimension, pixel format and pixel origin.
Definition Frame.h:30
This is the base class for all AVFoundation frame mediums.
Definition AVFFrameMedium.h:34
virtual void onNewSample(CVPixelBufferRef pixelBuffer, SharedAnyCamera anyCamera, const double unixTimestamp, const double sampleTime)
Called, if a new sample arrived.
AVFFrameMedium(const std::string &url)
Creates a new frame medium by a given url.
FrameType recentFrameType_
The frame type of the most recent.
Definition AVFFrameMedium.h:60
~AVFFrameMedium() override
Destructs a AVFFrameMedium object.
This is the base class for all AVFoundation mediums.
Definition AVFMedium.h:36
This is the base class for all frame mediums.
Definition FrameMedium.h:53
const std::string & url() const
Returns the url of the medium.
Definition Medium.h:236
std::shared_ptr< AnyCamera > SharedAnyCamera
Definition of a shared pointer holding an AnyCamera object with Scalar precision.
Definition AnyCamera.h:60
The namespace covering the entire Ocean framework.
Definition Accessor.h:15