IDisplayEventConnection.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright (C) 2011 The Android Open Source Project
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H
  17. #define ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H
  18. #include <stdint.h>
  19. #include <sys/types.h>
  20. #include <utils/Errors.h>
  21. #include <utils/RefBase.h>
  22. #include <binder/IInterface.h>
  23. namespace android {
  24. // ----------------------------------------------------------------------------
  25. class BitTube;
  26. class IDisplayEventConnection : public IInterface
  27. {
  28. public:
  29. DECLARE_META_INTERFACE(DisplayEventConnection);
  30. /*
  31. * getDataChannel() returns a BitTube where to receive the events from
  32. */
  33. virtual sp<BitTube> getDataChannel() const = 0;
  34. /*
  35. * setVsyncRate() sets the vsync event delivery rate. A value of
  36. * 1 returns every vsync events. A value of 2 returns every other events,
  37. * etc... a value of 0 returns no event unless requestNextVsync() has
  38. * been called.
  39. */
  40. virtual void setVsyncRate(uint32_t count) = 0;
  41. /*
  42. * requestNextVsync() schedules the next vsync event. It has no effect
  43. * if the vsync rate is > 0.
  44. */
  45. virtual void requestNextVsync() = 0; // asynchronous
  46. };
  47. // ----------------------------------------------------------------------------
  48. class BnDisplayEventConnection : public BnInterface<IDisplayEventConnection>
  49. {
  50. public:
  51. virtual status_t onTransact( uint32_t code,
  52. const Parcel& data,
  53. Parcel* reply,
  54. uint32_t flags = 0);
  55. };
  56. // ----------------------------------------------------------------------------
  57. }; // namespace android
  58. #endif // ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H