Skip to content

Commit c333e85

Browse files
author
Android Build Coastguard Worker
committed
Snap for 12727401 from 9a3ad9b to 25Q1-release
Change-Id: I5e012b2304c2d6594fc7e1eb51e0c56ebb65a6b6
2 parents cf24906 + 9a3ad9b commit c333e85

6 files changed

Lines changed: 6 additions & 164 deletions

File tree

include/android/performance_hint.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ typedef struct ASessionCreationConfig ASessionCreationConfig;
152152
*/
153153
typedef struct APerformanceHintSession APerformanceHintSession;
154154

155+
typedef struct ANativeWindow ANativeWindow;
156+
typedef struct ASurfaceControl ASurfaceControl;
157+
155158
/**
156159
* Acquire an instance of the performance hint manager.
157160
*

include/android/surface_control.h

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -780,69 +780,6 @@ void ASurfaceTransaction_setFrameRateWithChangeStrategy(ASurfaceTransaction* _No
780780
int8_t changeFrameRateStrategy)
781781
__INTRODUCED_IN(31);
782782

783-
/**
784-
* Sets the intended frame rate for the given \a surface_control.
785-
*
786-
* On devices that are capable of running the display at different frame rates,
787-
* the system may choose a display refresh rate to better match this surface's frame
788-
* rate. Usage of this API won't introduce frame rate throttling, or affect other
789-
* aspects of the application's frame production pipeline. However, because the system
790-
* may change the display refresh rate, calls to this function may result in changes
791-
* to Choreographer callback timings, and changes to the time interval at which the
792-
* system releases buffers back to the application.
793-
*
794-
* You can register for changes in the refresh rate using
795-
* \a AChoreographer_registerRefreshRateCallback.
796-
*
797-
* See ASurfaceTransaction_clearFrameRate().
798-
*
799-
* Available since API level 36.
800-
*
801-
* \param desiredMinRate The desired minimum frame rate (inclusive) for the surface, specifying that
802-
* the surface prefers the device render rate to be at least `desiredMinRate`.
803-
*
804-
* <p>Set `desiredMinRate` = `desiredMaxRate` to indicate the surface prefers an exact frame rate.
805-
*
806-
* <p>Set `desiredMinRate` = 0 to indicate the surface has no preference
807-
* and any frame rate is acceptable.
808-
*
809-
* <p>The value should be greater than or equal to 0.
810-
*
811-
* \param desiredMaxRate The desired maximum frame rate (inclusive) for the surface, specifying that
812-
* the surface prefers the device render rate to be at most `desiredMaxRate`.
813-
*
814-
* <p>Set `desiredMaxRate` = `desiredMinRate` to indicate the surface prefers an exact frame rate.
815-
*
816-
* <p>Set `desiredMaxRate` = positive infinity to indicate the surface has no preference
817-
* and any frame rate is acceptable.
818-
*
819-
* <p>The value should be greater than or equal to `desiredMinRate`.
820-
*
821-
* \param fixedSourceRate The "fixed source" frame rate of the surface if the content has an
822-
* inherently fixed frame rate, e.g. a video that has a specific frame rate.
823-
*
824-
* <p>When the frame rate chosen for the surface is the `fixedSourceRate` or a
825-
* multiple, the surface can render without frame pulldown, for optimal smoothness. For
826-
* example, a 30 fps video (`fixedSourceRate`=30) renders just as smoothly on 30 fps,
827-
* 60 fps, 90 fps, 120 fps, and so on.
828-
*
829-
* <p>Setting the fixed source rate can also be used together with a desired
830-
* frame rate min and max via setting `desiredMinRate` and `desiredMaxRate`. This still
831-
* means the surface's content has a fixed frame rate of `fixedSourceRate`, but additionally
832-
* specifies the preference to be in the range [`desiredMinRate`, `desiredMaxRate`]. For example, an
833-
* app might want to specify there is 30 fps video (`fixedSourceRate`=30) as well as a smooth
834-
* animation on the same surface which looks good when drawing within a frame rate range such as
835-
* [`desiredMinRate`, `desiredMaxRate`] = [60,120].
836-
*
837-
* \param changeFrameRateStrategy Whether display refresh rate transitions caused by this surface
838-
* should be seamless. A seamless transition is one that doesn't have any visual interruptions, such
839-
* as a black screen for a second or two.
840-
*/
841-
void ASurfaceTransaction_setFrameRateParams(
842-
ASurfaceTransaction* _Nonnull transaction, ASurfaceControl* _Nonnull surface_control,
843-
float desiredMinRate, float desiredMaxRate, float fixedSourceRate,
844-
ANativeWindow_ChangeFrameRateStrategy changeFrameRateStrategy) __INTRODUCED_IN(36);
845-
846783
/**
847784
* Clears the frame rate which is set for \a surface_control.
848785
*

libs/nativewindow/ANativeWindow.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -265,16 +265,6 @@ int32_t ANativeWindow_setFrameRateWithChangeStrategy(ANativeWindow* window, floa
265265
return native_window_set_frame_rate(window, frameRate, compatibility, changeFrameRateStrategy);
266266
}
267267

268-
int32_t ANativeWindow_setFrameRateParams(
269-
ANativeWindow* window, float desiredMinRate, float desiredMaxRate, float fixedSourceRate,
270-
ANativeWindow_ChangeFrameRateStrategy changeFrameRateStrategy) {
271-
if (!window || !query(window, NATIVE_WINDOW_IS_VALID)) {
272-
return -EINVAL;
273-
}
274-
return native_window_set_frame_rate_params(window, desiredMinRate, desiredMaxRate,
275-
fixedSourceRate, changeFrameRateStrategy);
276-
}
277-
278268
/**************************************************************************************************
279269
* vndk-stable
280270
**************************************************************************************************/

libs/nativewindow/include/android/native_window.h

Lines changed: 3 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
#ifndef ANDROID_NATIVE_WINDOW_H
3434
#define ANDROID_NATIVE_WINDOW_H
3535

36-
#include <stdbool.h>
3736
#include <stdint.h>
37+
#include <stdbool.h>
3838
#include <sys/cdefs.h>
3939

4040
#include <android/data_space.h>
@@ -282,7 +282,7 @@ int32_t ANativeWindow_setFrameRate(ANativeWindow* window, float frameRate, int8_
282282
void ANativeWindow_tryAllocateBuffers(ANativeWindow* window) __INTRODUCED_IN(30);
283283

284284
/** Change frame rate strategy value for ANativeWindow_setFrameRate. */
285-
typedef enum ANativeWindow_ChangeFrameRateStrategy : int8_t {
285+
enum ANativeWindow_ChangeFrameRateStrategy {
286286
/**
287287
* Change the frame rate only if the transition is going to be seamless.
288288
*/
@@ -292,7 +292,7 @@ typedef enum ANativeWindow_ChangeFrameRateStrategy : int8_t {
292292
* i.e. with visual interruptions for the user.
293293
*/
294294
ANATIVEWINDOW_CHANGE_FRAME_RATE_ALWAYS = 1
295-
} ANativeWindow_ChangeFrameRateStrategy __INTRODUCED_IN(31);
295+
} __INTRODUCED_IN(31);
296296

297297
/**
298298
* Sets the intended frame rate for this window.
@@ -344,76 +344,6 @@ int32_t ANativeWindow_setFrameRateWithChangeStrategy(ANativeWindow* window, floa
344344
int8_t compatibility, int8_t changeFrameRateStrategy)
345345
__INTRODUCED_IN(31);
346346

347-
/**
348-
* Sets the intended frame rate for this window.
349-
*
350-
* On devices that are capable of running the display at different frame rates,
351-
* the system may choose a display refresh rate to better match this surface's frame
352-
* rate. Usage of this API won't introduce frame rate throttling, or affect other
353-
* aspects of the application's frame production pipeline. However, because the system
354-
* may change the display refresh rate, calls to this function may result in changes
355-
* to Choreographer callback timings, and changes to the time interval at which the
356-
* system releases buffers back to the application.
357-
*
358-
* Note that this only has an effect for surfaces presented on the display. If this
359-
* surface is consumed by something other than the system compositor, e.g. a media
360-
* codec, this call has no effect.
361-
*
362-
* You can register for changes in the refresh rate using
363-
* \a AChoreographer_registerRefreshRateCallback.
364-
*
365-
* See ANativeWindow_clearFrameRate().
366-
*
367-
* Available since API level 36.
368-
*
369-
* \param window pointer to an ANativeWindow object.
370-
*
371-
* \param desiredMinRate The desired minimum frame rate (inclusive) for the window, specifying that
372-
* the surface prefers the device render rate to be at least `desiredMinRate`.
373-
*
374-
* <p>Set `desiredMinRate` = `desiredMaxRate` to indicate the surface prefers an exact frame rate.
375-
*
376-
* <p>Set `desiredMinRate` = 0 to indicate the window has no preference
377-
* and any frame rate is acceptable.
378-
*
379-
* <p>The value should be greater than or equal to 0.
380-
*
381-
* \param desiredMaxRate The desired maximum frame rate (inclusive) for the window, specifying that
382-
* the surface prefers the device render rate to be at most `desiredMaxRate`.
383-
*
384-
* <p>Set `desiredMaxRate` = `desiredMinRate` to indicate the surface prefers an exact frame rate.
385-
*
386-
* <p>Set `desiredMaxRate` = positive infinity to indicate the window has no preference
387-
* and any frame rate is acceptable.
388-
*
389-
* <p>The value should be greater than or equal to `desiredMinRate`.
390-
*
391-
* \param fixedSourceRate The "fixed source" frame rate of the window if the content has an
392-
* inherently fixed frame rate, e.g. a video that has a specific frame rate.
393-
*
394-
* <p>When the frame rate chosen for the surface is the `fixedSourceRate` or a
395-
* multiple, the surface can render without frame pulldown, for optimal smoothness. For
396-
* example, a 30 fps video (`fixedSourceRate`=30) renders just as smoothly on 30 fps,
397-
* 60 fps, 90 fps, 120 fps, and so on.
398-
*
399-
* <p>Setting the fixed source rate can also be used together with a desired
400-
* frame rate min and max via setting `desiredMinRate` and `desiredMaxRate`. This still
401-
* means the window's content has a fixed frame rate of `fixedSourceRate`, but additionally
402-
* specifies the preference to be in the range [`desiredMinRate`, `desiredMaxRate`]. For example, an
403-
* app might want to specify there is 30 fps video (`fixedSourceRate`=30) as well as a smooth
404-
* animation on the same window which looks good when drawing within a frame rate range such as
405-
* [`desiredMinRate`, `desiredMaxRate`] = [60,120].
406-
*
407-
* \param changeFrameRateStrategy Whether display refresh rate transitions caused by this surface
408-
* should be seamless. A seamless transition is one that doesn't have any visual interruptions, such
409-
* as a black screen for a second or two.
410-
*
411-
* \return 0 for success, -EINVAL if the arguments are invalid.
412-
*/
413-
int32_t ANativeWindow_setFrameRateParams(
414-
ANativeWindow* window, float desiredMinRate, float desiredMaxRate, float fixedSourceRate,
415-
ANativeWindow_ChangeFrameRateStrategy changeFrameRateStrategy) __INTRODUCED_IN(36);
416-
417347
/**
418348
* Clears the frame rate which is set for this window.
419349
*

libs/nativewindow/include/system/window.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,23 +1156,6 @@ static inline int native_window_set_frame_rate(struct ANativeWindow* window, flo
11561156
(int)compatibility, (int)changeFrameRateStrategy);
11571157
}
11581158

1159-
static inline int native_window_set_frame_rate_params(struct ANativeWindow* window,
1160-
float desiredMinRate, float desiredMaxRate,
1161-
float fixedSourceRate,
1162-
int8_t changeFrameRateStrategy) {
1163-
// TODO(b/362798998): Fix plumbing to send whole params
1164-
int compatibility = fixedSourceRate == 0 ? ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT
1165-
: ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_FIXED_SOURCE;
1166-
double frameRate = compatibility == ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_FIXED_SOURCE
1167-
? fixedSourceRate
1168-
: desiredMinRate;
1169-
if (desiredMaxRate < desiredMinRate) {
1170-
return -EINVAL;
1171-
}
1172-
return window->perform(window, NATIVE_WINDOW_SET_FRAME_RATE, frameRate, compatibility,
1173-
changeFrameRateStrategy);
1174-
}
1175-
11761159
struct ANativeWindowFrameTimelineInfo {
11771160
// Frame Id received from ANativeWindow_getNextFrameId.
11781161
uint64_t frameNumber;

libs/nativewindow/libnativewindow.map.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ LIBNATIVEWINDOW {
5353
ANativeWindow_setBuffersTransform;
5454
ANativeWindow_setDequeueTimeout; # systemapi introduced=30
5555
ANativeWindow_setFrameRate; # introduced=30
56-
ANativeWindow_setFrameRateParams; # introduced=36
5756
ANativeWindow_setFrameRateWithChangeStrategy; # introduced=31
5857
ANativeWindow_setSharedBufferMode; # llndk
5958
ANativeWindow_setSwapInterval; # llndk

0 commit comments

Comments
 (0)