bug 962719 use unsigned ints for FrameID and ProducerID for defined overflow behavior r=roc
authorKarl Tomlinson <karlt+@karlt.net>
Wed, 12 Aug 2015 11:02:41 +1200
changeset 257980 897a8a36022bff49bb6d473ea69a60c76680e96a
parent 257979 a79804d69e9bde2f543cc8de5b329ac5f03b4953
child 257981 b16ffdc7075f2c04fb3aab1746980c17ba986bc2
push id29238
push userryanvm@gmail.com
push dateMon, 17 Aug 2015 13:06:57 +0000
treeherdermozilla-central@a6eeb28458fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs962719
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 962719 use unsigned ints for FrameID and ProducerID for defined overflow behavior r=roc
dom/media/MediaData.h
dom/media/MediaDecoderStateMachine.cpp
gfx/layers/ImageContainer.h
gfx/layers/ipc/LayersMessages.ipdlh
--- a/dom/media/MediaData.h
+++ b/dom/media/MediaData.h
@@ -303,17 +303,17 @@ public:
   bool mSentToCompositor;
 
   VideoData(int64_t aOffset,
             int64_t aTime,
             int64_t aDuration,
             bool aKeyframe,
             int64_t aTimecode,
             IntSize aDisplay,
-            int32_t aFrameID);
+            uint32_t aFrameID);
 
 protected:
   ~VideoData();
 };
 
 class CryptoTrack
 {
 public:
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2536,17 +2536,17 @@ void MediaDecoderStateMachine::RenderVid
     }
 
     ImageContainer::NonOwningImage* img = images.AppendElement();
     img->mTimeStamp = t;
     img->mImage = frame->mImage;
     img->mFrameID = frame->mFrameID;
     img->mProducerID = mProducerID;
 
-    VERBOSE_LOG("playing video frame %lld (id=%d) (queued=%i, state-machine=%i, decoder-queued=%i)",
+    VERBOSE_LOG("playing video frame %lld (id=%x) (queued=%i, state-machine=%i, decoder-queued=%i)",
                 frame->mTime, frame->mFrameID,
                 VideoQueue().GetSize() + mReader->SizeOfVideoQueueInFrames(),
                 VideoQueue().GetSize(), mReader->SizeOfVideoQueueInFrames());
   }
 
   container->SetCurrentFrames(frames[0]->As<VideoData>()->mDisplay, images);
 }
 
--- a/gfx/layers/ImageContainer.h
+++ b/gfx/layers/ImageContainer.h
@@ -283,18 +283,18 @@ class ImageContainer final : public Supp
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ImageContainer)
 public:
   MOZ_DECLARE_WEAKREFERENCE_TYPENAME(ImageContainer)
 
   enum Mode { SYNCHRONOUS = 0x0, ASYNCHRONOUS = 0x01, ASYNCHRONOUS_OVERLAY = 0x02 };
 
   explicit ImageContainer(ImageContainer::Mode flag = SYNCHRONOUS);
 
-  typedef int32_t FrameID;
-  typedef int32_t ProducerID;
+  typedef uint32_t FrameID;
+  typedef uint32_t ProducerID;
 
 
   /**
    * Create an Image in one of the given formats.
    * Picks the "best" format from the list and creates an Image of that
    * format.
    * Returns null if this backend does not support any of the formats.
    * Can be called on any thread. This method takes mReentrantMonitor
--- a/gfx/layers/ipc/LayersMessages.ipdlh
+++ b/gfx/layers/ipc/LayersMessages.ipdlh
@@ -387,18 +387,18 @@ union MaybeFence {
   null_t;
 };
 
 struct TimedTexture {
   PTexture texture;
   MaybeFence fence;
   TimeStamp timeStamp;
   IntRect picture;
-  int32_t frameID;
-  int32_t producerID;
+  uint32_t frameID;
+  uint32_t producerID;
 };
 
 /**
  * Tells the compositor-side which textures to use (for example, as front buffer
  * if there are several textures for double buffering).
  * This provides a list of textures with timestamps, ordered by timestamp.
  * The newest texture whose timestamp is <= the current time is rendered
  * (where null is considered less than every other timestamp). If there is no
@@ -482,18 +482,18 @@ struct OpContentBufferSwap {
 /**
  * An ImageCompositeNotification is sent the first time a particular
  * image is composited by an ImageHost.
  */
 struct ImageCompositeNotification {
   PImageContainer imageContainer;
   TimeStamp imageTimeStamp;
   TimeStamp firstCompositeTimeStamp;
-  int32_t frameID;
-  int32_t producerID;
+  uint32_t frameID;
+  uint32_t producerID;
 };
 
 // Unit of a "changeset reply".  This is a weird abstraction, probably
 // only to be used for buffer swapping.
 union EditReply {
   OpContentBufferSwap;
 };