Skip to content

Commit

Permalink
bug fix in packet reader/writer
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruslan-B committed Jul 10, 2013
1 parent 17e4422 commit 713f1d6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion AR.Drone.Media/PacketReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public VideoPacket ReadVideoPacket()
return packet;
}

public new object Read()
public object ReadPacket()
{
try
{
Expand Down
2 changes: 1 addition & 1 deletion AR.Drone.Media/PacketRecorder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected override void Loop(CancellationToken token)
object packet;
while (_packetQueue.TryDequeue(out packet))
{
recorder.Write(packet);
recorder.WritePacket(packet);
}
Thread.Sleep(1);
}
Expand Down
2 changes: 1 addition & 1 deletion AR.Drone.Media/PacketWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public PacketWriter(Stream stream) : base(stream)
{
}

public void Write(object packet)
public void WritePacket(object packet)
{
if (packet == null) throw new NullReferenceException();

Expand Down
10 changes: 6 additions & 4 deletions AR.Drone.WinApp/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ protected override void OnClosed(EventArgs e)

private void OnNavigationPacketAcquired(NavigationPacket packet)
{
//if (_packetRecorderWorker.IsAlive)
// _packetRecorderWorker.EnqueuePacket(packet);
if (_packetRecorderWorker.IsAlive)
_packetRecorderWorker.EnqueuePacket(packet);

_navigationPacket = packet;
}
Expand All @@ -81,10 +81,12 @@ private void OnVideoPacketDecoded(VideoFrame frame)

private void OnConfigurationUpdated(DroneConfiguration configuration)
{
if (configuration.Video.Codec != VideoCodecType.H264_360P ||
if (configuration.Video.Codec != VideoCodecType.H264_360P_SLRS ||
configuration.Video.MaxBitrate != 100 ||
configuration.Video.BitrateCtrlMode != VideoBitrateControlMode.Dynamic)
{
_droneClient.Send(configuration.Video.Codec.Set(VideoCodecType.H264_360P).ToCommand());
_droneClient.Send(configuration.Video.Codec.Set(VideoCodecType.H264_360P_SLRS).ToCommand());
_droneClient.Send(configuration.Video.MaxBitrate.Set(100).ToCommand());
_droneClient.Send(configuration.Video.BitrateCtrlMode.Set(VideoBitrateControlMode.Dynamic).ToCommand());
}
}
Expand Down

0 comments on commit 713f1d6

Please sign in to comment.